From 45c58077f777496f013fe1ef58cbbde16a63a781 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 16 Oct 2012 19:52:55 +0000 Subject: 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 --- source/Simulator/FloodyFluidSimulator.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'source/Simulator') 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; } -- cgit v1.2.3