diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-20 14:39:14 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-20 14:39:14 +0200 |
commit | ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9 (patch) | |
tree | 3e65e9559be11ea9365cf2dc708b209eb530e164 /src/Entities | |
parent | NBTChunkSerializer.cpp: Added break after serializing the splash potion (diff) | |
download | cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.tar cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.tar.gz cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.tar.bz2 cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.tar.lz cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.tar.xz cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.tar.zst cuberite-ba24f50e5ec36c4f4a119900e2dce9ff4b037ca9.zip |
Diffstat (limited to 'src/Entities')
-rw-r--r-- | src/Entities/SplashPotionEntity.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp index c1623845f..6d874e957 100644 --- a/src/Entities/SplashPotionEntity.cpp +++ b/src/Entities/SplashPotionEntity.cpp @@ -33,15 +33,16 @@ public: /** Called by cWorld::ForEachEntity(), adds the stored entity effect to the entity, if it is close enough. */ virtual bool Item(cEntity * a_Entity) override { - double SplashDistance = (a_Entity->GetPosition() - m_HitPos).Length(); - if (SplashDistance >= 20) + if (!a_Entity->IsPawn()) { - // Too far away + // Not an entity that can take effects return false; } - if (!a_Entity->IsPawn()) + + double SplashDistance = (a_Entity->GetPosition() - m_HitPos).Length(); + if (SplashDistance >= 20) { - // Not an entity that can take effects + // Too far away return false; } @@ -114,7 +115,7 @@ void cSplashPotionEntity::Splash(const Vector3d & a_HitPos) cSplashPotionCallback Callback(a_HitPos, m_EntityEffectType, m_EntityEffect); m_World->ForEachEntity(Callback); - m_World->BroadcastSoundParticleEffect(2002, (int)a_HitPos.x, (int)a_HitPos.y, (int)a_HitPos.z, m_PotionColor); + m_World->BroadcastSoundParticleEffect(2002, (int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z), m_PotionColor); } |