1
0

Fix explosions trying to write to unread blockarea

This commit is contained in:
Tiger Wang 2015-04-26 19:17:08 +01:00
parent 27413bcec3
commit b10336ad64

View File

@ -1880,10 +1880,12 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_
if (ShouldDestroyBlocks) if (ShouldDestroyBlocks)
{ {
cBlockArea area; cBlockArea area;
a_BlocksAffected.reserve(8 * ExplosionSizeInt * ExplosionSizeInt * ExplosionSizeInt); a_BlocksAffected.reserve(8 * ExplosionSizeInt * ExplosionSizeInt * ExplosionSizeInt);
if (!area.Read(m_World, bx - ExplosionSizeInt, (int)ceil(a_BlockX + ExplosionSizeInt), MinY, MaxY, bz - ExplosionSizeInt, (int)ceil(a_BlockZ + ExplosionSizeInt)))
area.Read(m_World, bx - ExplosionSizeInt, (int)ceil(a_BlockX + ExplosionSizeInt), MinY, MaxY, bz - ExplosionSizeInt, (int)ceil(a_BlockZ + ExplosionSizeInt)); {
return;
}
for (int x = -ExplosionSizeInt; x < ExplosionSizeInt; x++) for (int x = -ExplosionSizeInt; x < ExplosionSizeInt; x++)
{ {
for (int y = -ExplosionSizeInt; y < ExplosionSizeInt; y++) for (int y = -ExplosionSizeInt; y < ExplosionSizeInt; y++)