summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-19 10:32:55 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-19 10:32:55 +0200
commitfd534d18f1679eb1227900cd200ab2f3a13bac07 (patch)
tree439043e26cbd6da01c5b4e2d597fbdbb96056d57
parentFixed Linux compilation, slight code cleanup (diff)
downloadcuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.tar
cuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.tar.gz
cuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.tar.bz2
cuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.tar.lz
cuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.tar.xz
cuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.tar.zst
cuberite-fd534d18f1679eb1227900cd200ab2f3a13bac07.zip
-rw-r--r--source/World.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/World.cpp b/source/World.cpp
index 312249709..418f078eb 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -708,11 +708,13 @@ void cWorld::DoExplosiontAt(float a_ExplosionSize, int a_BlockX, int a_BlockY, i
// TODO: implement explosion using cBlockArea / in cChunkMap, add damage to entities, add support for pickups, and implement block hardiness
Vector3d explosion_pos = Vector3d(a_BlockX,a_BlockY,a_BlockZ);
cVector3iArray BlocksAffected;
- for (int x = 0; x < a_ExplosionSize; x++)
+ int ExplosionSizeInt = (int)a_ExplosionSize;
+ BlocksAffected.reserve(8 * ExplosionSizeInt * ExplosionSizeInt * ExplosionSizeInt);
+ for (int x = 0; x < ExplosionSizeInt; x++)
{
- for (int y = 0; y < a_ExplosionSize; y++)
+ for (int y = 0; y < ExplosionSizeInt; y++)
{
- for (int z = 0; z < a_ExplosionSize; z++)
+ for (int z = 0; z < ExplosionSizeInt; z++)
{
DigBlock(a_BlockX + x, a_BlockY + y, a_BlockZ + z);
DigBlock(a_BlockX + x, a_BlockY - y, a_BlockZ + z);