diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-16 21:52:55 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-16 21:52:55 +0200 |
commit | 45c58077f777496f013fe1ef58cbbde16a63a781 (patch) | |
tree | 2478d7e5376a71694a09e3ed995f8b2aa211efd5 /source/Simulator/FloodyFluidSimulator.cpp | |
parent | Decreased logging in floody fluid simulator. (diff) | |
download | cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.tar cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.tar.gz cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.tar.bz2 cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.tar.lz cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.tar.xz cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.tar.zst cuberite-45c58077f777496f013fe1ef58cbbde16a63a781.zip |
Diffstat (limited to 'source/Simulator/FloodyFluidSimulator.cpp')
-rw-r--r-- | source/Simulator/FloodyFluidSimulator.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source/Simulator/FloodyFluidSimulator.cpp b/source/Simulator/FloodyFluidSimulator.cpp index 0604957f1..25b43606b 100644 --- a/source/Simulator/FloodyFluidSimulator.cpp +++ b/source/Simulator/FloodyFluidSimulator.cpp @@ -107,8 +107,8 @@ bool cFloodyFluidSimulator::CheckTributaries(int a_BlockX, int a_BlockY, int a_B IsFed = IsAnyFluidBlock(a_Area.GetRelBlockType(1, 2, 1));
}
- // If not fed from above, check if there's a feed from the side:
- if (!IsFed)
+ // 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 && (a_MyMeta != 8))
{
IsFed = (
(IsAllowedBlock(a_Area.GetRelBlockType(0, y, 1)) && IsHigherMeta(a_Area.GetRelBlockMeta(0, y, 1), a_MyMeta)) ||
@@ -121,16 +121,24 @@ bool cFloodyFluidSimulator::CheckTributaries(int a_BlockX, int a_BlockY, int a_B // If not fed, decrease by m_Falloff levels:
if (!IsFed)
{
- FLOG(" Not fed, decreasing from %d to %d", a_MyMeta, a_MyMeta + m_Falloff);
-
- a_MyMeta += m_Falloff;
- if (a_MyMeta < 8)
+ if (a_MyMeta >= 8)
{
- m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, m_StationaryFluidBlock, a_MyMeta);
+ 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
{
- m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
+ a_MyMeta += m_Falloff;
+ 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);
+ }
+ else
+ {
+ FLOG(" Not fed, meta %d, erasing altogether", a_MyMeta);
+ m_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
+ }
}
return true;
}
|