diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-04-26 20:17:08 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-04-26 20:17:08 +0200 |
commit | b10336ad64aedaa85d7a48c4e578b1f4628693c3 (patch) | |
tree | 7836cba3d0a033996d28d805c733b116eac2a0b1 /src | |
parent | Update contributing.md with C++11 (diff) | |
download | cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.tar cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.tar.gz cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.tar.bz2 cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.tar.lz cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.tar.xz cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.tar.zst cuberite-b10336ad64aedaa85d7a48c4e578b1f4628693c3.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/ChunkMap.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 394dc703b..b84b8dc3d 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1880,10 +1880,12 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_ if (ShouldDestroyBlocks) { cBlockArea area; - a_BlocksAffected.reserve(8 * ExplosionSizeInt * ExplosionSizeInt * ExplosionSizeInt); - - area.Read(m_World, bx - ExplosionSizeInt, (int)ceil(a_BlockX + ExplosionSizeInt), MinY, MaxY, bz - ExplosionSizeInt, (int)ceil(a_BlockZ + ExplosionSizeInt)); + if (!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 y = -ExplosionSizeInt; y < ExplosionSizeInt; y++) |