From 994036a3b8b09f8da1b6ec2055cc7a5ceb05a776 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 3 May 2020 20:04:33 +0000 Subject: Add cEntity::GetBoundingBox, and use where appropriate. (#4711) * Add cEntity::GetBoundingBox, and use where appropriate. --- src/ChunkMap.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ChunkMap.cpp') diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 1713173f8..0ff4d5ff7 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1298,9 +1298,8 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_ if (!a_Entity.IsTNT() && !a_Entity.IsFallingBlock()) // Don't apply damage to other TNT entities and falling blocks, they should be invincible { - cBoundingBox bbEntity(a_Entity.GetPosition(), a_Entity.GetWidth() / 2, a_Entity.GetHeight()); - - if (!bbTNT.IsInside(bbEntity)) // If bbEntity is inside bbTNT, not vice versa! + auto EntityBox = a_Entity.GetBoundingBox(); + if (!bbTNT.IsInside(EntityBox)) // If entity box is inside tnt box, not vice versa! { return false; } -- cgit v1.2.3