summaryrefslogtreecommitdiffstats
path: root/source/Blocks
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-27 15:23:20 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-27 15:23:20 +0200
commit1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a (patch)
treec5ab9b421d24495c5280463c29d71dd30ee6f255 /source/Blocks
parentInitial version of "DistortedMembraneOverhangs" (diff)
downloadcuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.gz
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.bz2
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.lz
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.xz
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.zst
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.zip
Diffstat (limited to 'source/Blocks')
-rw-r--r--source/Blocks/BlockHandler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp
index 4b7aa6fa2..816c6f7e6 100644
--- a/source/Blocks/BlockHandler.cpp
+++ b/source/Blocks/BlockHandler.cpp
@@ -288,7 +288,10 @@ void cBlockHandler::OnDestroyed(cWorld *a_World, int a_BlockX, int a_BlockY, int
void cBlockHandler::NeighborChanged(cWorld *a_World, int a_BlockX, int a_BlockY, int a_BlockZ)
{
- GetBlockHandler(a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ))->OnNeighborChanged(a_World, a_BlockX, a_BlockY, a_BlockZ);
+ if ((a_BlockY >= 0) && (a_BlockY < cChunkDef::Height))
+ {
+ GetBlockHandler(a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ))->OnNeighborChanged(a_World, a_BlockX, a_BlockY, a_BlockZ);
+ }
}