From 6cf3aa70f1d7291136a25c2b289113fb15ba68dc Mon Sep 17 00:00:00 2001 From: gushromp Date: Tue, 16 Dec 2014 22:38:57 +0100 Subject: Fixed water from spreading on bottom of world --- src/Simulator/FloodyFluidSimulator.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp index e95ef216d..5e0f88ab6 100644 --- a/src/Simulator/FloodyFluidSimulator.cpp +++ b/src/Simulator/FloodyFluidSimulator.cpp @@ -58,6 +58,7 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re BLOCKTYPE MyBlock; NIBBLETYPE MyMeta; a_Chunk->GetBlockTypeMeta(a_RelX, a_RelY, a_RelZ, MyBlock, MyMeta); + if (!IsAnyFluidBlock(MyBlock)) { // Can happen - if a block is scheduled for simulating and gets replaced in the meantime. @@ -115,13 +116,15 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re // Also has been re-scheduled for ticking in the next wave, so no marking is needed return; } + + else if (SpreadFurther && (NewMeta < 8)) + { + // Spread to the neighbors: + SpreadXZ(a_Chunk, a_RelX, a_RelY, a_RelZ, NewMeta); + } } - if (SpreadFurther && (NewMeta < 8)) - { - // Spread to the neighbors: - SpreadXZ(a_Chunk, a_RelX, a_RelY, a_RelZ, NewMeta); - } + // Mark as processed: a_Chunk->FastSetBlock(a_RelX, a_RelY, a_RelZ, m_StationaryFluidBlock, MyMeta); -- cgit v1.2.3 From fd325e3990e168c2cf1838b770b019086765080d Mon Sep 17 00:00:00 2001 From: gushromp Date: Tue, 16 Dec 2014 22:38:57 +0100 Subject: Fixed water from spreading on bottom of world --- src/Simulator/FloodyFluidSimulator.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp index e95ef216d..53eb98c2a 100644 --- a/src/Simulator/FloodyFluidSimulator.cpp +++ b/src/Simulator/FloodyFluidSimulator.cpp @@ -83,7 +83,7 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re return; } } - + // New meta for the spreading to neighbors: // If this is a source block or was falling, the new meta is just the falloff // Otherwise it is the current meta plus falloff (may be larger than max height, will be checked later) @@ -103,6 +103,11 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re SpreadFurther = false; } } + // Spread to the neighbors: + if (SpreadFurther && (NewMeta < 8)) + { + SpreadXZ(a_Chunk, a_RelX, a_RelY, a_RelZ, NewMeta); + } // If source creation is on, check for it here: else if ( (m_NumNeighborsForSource > 0) && // Source creation is on @@ -115,14 +120,13 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re // Also has been re-scheduled for ticking in the next wave, so no marking is needed return; } + + } - if (SpreadFurther && (NewMeta < 8)) - { - // Spread to the neighbors: - SpreadXZ(a_Chunk, a_RelX, a_RelY, a_RelZ, NewMeta); - } - + + + // Mark as processed: a_Chunk->FastSetBlock(a_RelX, a_RelY, a_RelZ, m_StationaryFluidBlock, MyMeta); } -- cgit v1.2.3 From 99055f644b527f5e20b26c3914acfe9a2d1c8d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 17 Dec 2014 11:25:59 +0100 Subject: Removed unneeded newlines --- src/Simulator/FloodyFluidSimulator.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp index 1d638737e..37d58307b 100644 --- a/src/Simulator/FloodyFluidSimulator.cpp +++ b/src/Simulator/FloodyFluidSimulator.cpp @@ -58,7 +58,6 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re BLOCKTYPE MyBlock; NIBBLETYPE MyMeta; a_Chunk->GetBlockTypeMeta(a_RelX, a_RelY, a_RelZ, MyBlock, MyMeta); - if (!IsAnyFluidBlock(MyBlock)) { // Can happen - if a block is scheduled for simulating and gets replaced in the meantime. @@ -121,12 +120,7 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re // Also has been re-scheduled for ticking in the next wave, so no marking is needed return; } - - } - - - // Mark as processed: a_Chunk->FastSetBlock(a_RelX, a_RelY, a_RelZ, m_StationaryFluidBlock, MyMeta); -- cgit v1.2.3