diff options
author | Mattes D <github@xoft.cz> | 2014-07-19 13:31:35 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-07-19 13:31:35 +0200 |
commit | c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc (patch) | |
tree | a8de103269fb7ef98a726e51bf8fcdfd17702ab9 /src/ChunkMap.cpp | |
parent | Merge pull request #1224 from mc-server/fixes-potions (diff) | |
parent | World.cpp: fixed not all enum fields being used in m_Dimension switch (diff) | |
download | cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.gz cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.bz2 cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.lz cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.xz cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.zst cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index e91f77d27..49e9245d2 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1951,10 +1951,7 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_ double FinalDamage = (((1 / AbsoluteEntityPos.x) + (1 / AbsoluteEntityPos.y) + (1 / AbsoluteEntityPos.z)) * 2) * m_ExplosionSize; // Clip damage values - if (FinalDamage > a_Entity->GetMaxHealth()) - FinalDamage = a_Entity->GetMaxHealth(); - else if (FinalDamage < 0) - FinalDamage = 0; + FinalDamage = Clamp(FinalDamage, 0.0, (double)a_Entity->GetMaxHealth()); if (!a_Entity->IsTNT() && !a_Entity->IsFallingBlock()) // Don't apply damage to other TNT entities and falling blocks, they should be invincible { |