summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-10 21:46:12 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-10 21:46:12 +0200
commitae5975e674122148f979a211bcf82094c5d0a206 (patch)
treeb94884f7a00ac9e820d27d5213996ad6cf176b7e /source/ClientHandle.cpp
parentRemoved some logging (diff)
downloadcuberite-ae5975e674122148f979a211bcf82094c5d0a206.tar
cuberite-ae5975e674122148f979a211bcf82094c5d0a206.tar.gz
cuberite-ae5975e674122148f979a211bcf82094c5d0a206.tar.bz2
cuberite-ae5975e674122148f979a211bcf82094c5d0a206.tar.lz
cuberite-ae5975e674122148f979a211bcf82094c5d0a206.tar.xz
cuberite-ae5975e674122148f979a211bcf82094c5d0a206.tar.zst
cuberite-ae5975e674122148f979a211bcf82094c5d0a206.zip
Diffstat (limited to 'source/ClientHandle.cpp')
-rw-r--r--source/ClientHandle.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index f019fd862..f526432b4 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -887,6 +887,15 @@ void cClientHandle::HandleUseEntity(int a_TargetEntityID, bool a_IsLeftClick)
{
virtual bool Item(cEntity * a_Entity) override
{
+ if (a_Entity->GetWorld()->IsPVPEnabled() == false)
+ {
+ // PVP is disabled
+ if (a_Entity->IsA("cPlayer") && Instigator->IsA("cPlayer"))
+ {
+ // Player is hurting another player which is not allowed when PVP is disabled so ignore it
+ return true;
+ }
+ }
if (a_Entity->IsA("cPawn"))
{
reinterpret_cast<cPawn *>(a_Entity)->TakeDamage(Damage, Instigator);