1
0

Fluid simulator: fixed an out-of-bounds read when determining fluid direction

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1280 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-03-17 13:24:27 +00:00
parent 5e24cb38ac
commit 84a6a3d968

View File

@ -119,12 +119,15 @@ bool cFluidSimulator::IsHigherMeta(NIBBLETYPE a_Meta1, NIBBLETYPE a_Meta2)
// TODO Not working very well yet :s
Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a_Over)
{
char BlockID = m_World.GetBlock(a_X, a_Y, a_Z);
if ((a_Y < 0) || (a_Y >= cChunkDef::Height))
{
return NONE;
}
BLOCKTYPE BlockID = m_World.GetBlock(a_X, a_Y, a_Z);
if (!IsAllowedBlock(BlockID)) // No Fluid -> No Flowing direction :D
{
return NONE;
}
/*
Disabled because of causing problems and being useless atm