1
0

Fixed a few possible crashes with out-of-bounds Y coords

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1413 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-04-27 13:23:20 +00:00
parent c40eb92de3
commit 1b7ea2ef82
2 changed files with 16 additions and 1 deletions

View File

@@ -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);
}
}