summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-19 10:40:29 +0200
committerarchshift <admin@archshift.com>2014-07-19 10:40:29 +0200
commit041bfd5860cd8ef51db42eb6fb4b50b45549feba (patch)
tree2d93a68b888a5e2b410ec95d124edaad6f67bb92 /src/ChunkMap.cpp
parentRenamed AllToLua_lua script. (diff)
downloadcuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.gz
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.bz2
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.lz
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.xz
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.zst
cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkMap.cpp5
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
{