summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-12 14:28:37 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-12 14:28:37 +0100
commitec6c510bd404524dc63d130b41329fb365423b4b (patch)
treed2b8a8bea0930b7004575342d1036519879c8688 /src/Entities/Entity.cpp
parentMerge pull request #529 from mc-server/derpstonerefactor (diff)
downloadcuberite-ec6c510bd404524dc63d130b41329fb365423b4b.tar
cuberite-ec6c510bd404524dc63d130b41329fb365423b4b.tar.gz
cuberite-ec6c510bd404524dc63d130b41329fb365423b4b.tar.bz2
cuberite-ec6c510bd404524dc63d130b41329fb365423b4b.tar.lz
cuberite-ec6c510bd404524dc63d130b41329fb365423b4b.tar.xz
cuberite-ec6c510bd404524dc63d130b41329fb365423b4b.tar.zst
cuberite-ec6c510bd404524dc63d130b41329fb365423b4b.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 8a74c9da4..fbf76e008 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -321,7 +321,10 @@ void cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
m_Health = 0;
}
- AddSpeed(a_TDI.Knockback * 2);
+ if (IsMob() || IsPlayer()) // Knockback for only players and mobs
+ {
+ AddSpeed(a_TDI.Knockback * 2);
+ }
m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_HURT);