Fixed floody fluid sim making downward fluid behave like source blocks.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@970 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
226b9ad8eb
commit
45c58077f7
@ -107,8 +107,8 @@ bool cFloodyFluidSimulator::CheckTributaries(int a_BlockX, int a_BlockY, int a_B
|
|||||||
IsFed = IsAnyFluidBlock(a_Area.GetRelBlockType(1, 2, 1));
|
IsFed = IsAnyFluidBlock(a_Area.GetRelBlockType(1, 2, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not fed from above, check if there's a feed from the side:
|
// If not fed from above, check if there's a feed from the side (but not if it's a downward-flowing block):
|
||||||
if (!IsFed)
|
if (!IsFed && (a_MyMeta != 8))
|
||||||
{
|
{
|
||||||
IsFed = (
|
IsFed = (
|
||||||
(IsAllowedBlock(a_Area.GetRelBlockType(0, y, 1)) && IsHigherMeta(a_Area.GetRelBlockMeta(0, y, 1), a_MyMeta)) ||
|
(IsAllowedBlock(a_Area.GetRelBlockType(0, y, 1)) && IsHigherMeta(a_Area.GetRelBlockMeta(0, y, 1), a_MyMeta)) ||
|
||||||
@ -121,17 +121,25 @@ bool cFloodyFluidSimulator::CheckTributaries(int a_BlockX, int a_BlockY, int a_B
|
|||||||
// If not fed, decrease by m_Falloff levels:
|
// If not fed, decrease by m_Falloff levels:
|
||||||
if (!IsFed)
|
if (!IsFed)
|
||||||
{
|
{
|
||||||
FLOG(" Not fed, decreasing from %d to %d", a_MyMeta, a_MyMeta + m_Falloff);
|
if (a_MyMeta >= 8)
|
||||||
|
{
|
||||||
|
FLOG(" Not fed and downwards, turning into non-downwards meta %d", m_Falloff);
|
||||||
|
m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_StationaryFluidBlock, m_Falloff);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
a_MyMeta += m_Falloff;
|
a_MyMeta += m_Falloff;
|
||||||
if (a_MyMeta < 8)
|
if (a_MyMeta < 8)
|
||||||
{
|
{
|
||||||
|
FLOG(" Not fed, decreasing from %d to %d", a_MyMeta, a_MyMeta + m_Falloff);
|
||||||
m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_StationaryFluidBlock, a_MyMeta);
|
m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_StationaryFluidBlock, a_MyMeta);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
FLOG(" Not fed, meta %d, erasing altogether", a_MyMeta);
|
||||||
m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
|
m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user