1
0

Fix invalid explosion damage (#4529)

This commit is contained in:
Mat 2020-03-22 15:02:21 +02:00 committed by GitHub
parent 581c1e5034
commit 00ae9604e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<int>((1 / DistanceFromExplosion.Length()) * 6 * ExplosionSizeInt), 0);
a_Entity.TakeDamage(dtExplosion, nullptr, static_cast<int>((1 / std::max(1.0, DistanceFromExplosion.Length())) * 8 * ExplosionSizeInt), 0);
}
double Length = DistanceFromExplosion.Length();