From af66f8ebae0add1b49878392d1d767590598ebf2 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 20 Dec 2012 13:56:42 +0000 Subject: Fixed a crash in redstone simulator when destroying blocks in Y < 2 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1084 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Simulator/RedstoneSimulator.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- cgit v1.2.3