1
0

Fix explosion interaction with block entities. (#4052)

* WriteBlockArea: Fix erasing of block entities.

* cChunkMap::DoExplosionAt destroys block entities
This commit is contained in:
peterbell10
2017-09-27 22:22:15 +01:00
committed by Alexander Harkness
parent 4b14a5b4c1
commit 8866a28cf8
2 changed files with 17 additions and 3 deletions

View File

@@ -452,14 +452,15 @@ void cChunk::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock
} // for y
// Erase all affected block entities:
cCuboid affectedArea(
{OffX, a_MinBlockY, OffZ},
{OffX + SizeX - 1, a_MinBlockY + SizeY - 1, OffZ + SizeZ - 1}
cCuboid affectedArea( // In world coordinates
{BlockStartX, a_MinBlockY, BlockStartZ},
{BlockEndX, a_MinBlockY + SizeY - 1, BlockEndZ}
);
for (auto itr = m_BlockEntities.begin(); itr != m_BlockEntities.end();)
{
if (affectedArea.IsInside(itr->second->GetPos()))
{
delete itr->second;
itr = m_BlockEntities.erase(itr);
}
else