summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Simulator/RedstoneSimulator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/Simulator/RedstoneSimulator.cpp b/source/Simulator/RedstoneSimulator.cpp
index afc5cca3d..2224d300d 100644
--- a/source/Simulator/RedstoneSimulator.cpp
+++ b/source/Simulator/RedstoneSimulator.cpp
@@ -456,6 +456,10 @@ int cRedstoneSimulator::UnPowerBlock( const Vector3i & a_BlockPos, const Vector3
{
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
+ if ((a_BlockPos.y < 0) || (a_BlockPos.y >= cChunkDef::Height))
+ {
+ return 0;
+ }
m_World->GetBlockTypeMeta(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, BlockType, BlockMeta);
switch (BlockType)
{