From 00ae9604e11e2f0859fb219029c903662fe27bfd Mon Sep 17 00:00:00 2001 From: Mat Date: Sun, 22 Mar 2020 15:02:21 +0200 Subject: Fix invalid explosion damage (#4529) --- src/ChunkMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 364dfbb3d..98d63df94 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1303,7 +1303,7 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_ } // Ensure that the damage dealt is inversely proportional to the distance to the TNT centre - the closer a player is, the harder they are hit - a_Entity.TakeDamage(dtExplosion, nullptr, static_cast((1 / DistanceFromExplosion.Length()) * 6 * ExplosionSizeInt), 0); + a_Entity.TakeDamage(dtExplosion, nullptr, static_cast((1 / std::max(1.0, DistanceFromExplosion.Length())) * 8 * ExplosionSizeInt), 0); } double Length = DistanceFromExplosion.Length(); -- cgit v1.2.3