diff options
author | madmaxoft <github@xoft.cz> | 2014-03-06 13:24:28 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-03-06 13:24:28 +0100 |
commit | 3e80e636653274d138c1c5c6551e81a267b4d467 (patch) | |
tree | 821b710200bdccbd68386a34b83a425f15ee9b7d /src/Simulator/FloodyFluidSimulator.cpp | |
parent | Merge pull request #747 from mc-server/InfoDump_Github (diff) | |
parent | Implemented vanilla-like fluid simulator (diff) | |
download | cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.gz cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.bz2 cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.lz cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.xz cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.zst cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.zip |
Diffstat (limited to 'src/Simulator/FloodyFluidSimulator.cpp')
-rw-r--r-- | src/Simulator/FloodyFluidSimulator.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp index 95182345c..b1ac734d7 100644 --- a/src/Simulator/FloodyFluidSimulator.cpp +++ b/src/Simulator/FloodyFluidSimulator.cpp @@ -86,7 +86,12 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re { // Spread only down, possibly washing away what's there or turning lava to stone / cobble / obsidian: SpreadToNeighbor(a_Chunk, a_RelX, a_RelY - 1, a_RelZ, 8); - SpreadFurther = false; + + // Source blocks spread both downwards and sideways + if (MyMeta != 0) + { + SpreadFurther = false; + } } // If source creation is on, check for it here: else if ( @@ -105,10 +110,7 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re if (SpreadFurther && (NewMeta < 8)) { // Spread to the neighbors: - SpreadToNeighbor(a_Chunk, a_RelX - 1, a_RelY, a_RelZ, NewMeta); - SpreadToNeighbor(a_Chunk, a_RelX + 1, a_RelY, a_RelZ, NewMeta); - SpreadToNeighbor(a_Chunk, a_RelX, a_RelY, a_RelZ - 1, NewMeta); - SpreadToNeighbor(a_Chunk, a_RelX, a_RelY, a_RelZ + 1, NewMeta); + Spread(a_Chunk, a_RelX, a_RelY, a_RelZ, NewMeta); } // Mark as processed: @@ -119,6 +121,17 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re +void cFloodyFluidSimulator::Spread(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_NewMeta) +{ + SpreadToNeighbor(a_Chunk, a_RelX - 1, a_RelY, a_RelZ, a_NewMeta); + SpreadToNeighbor(a_Chunk, a_RelX + 1, a_RelY, a_RelZ, a_NewMeta); + SpreadToNeighbor(a_Chunk, a_RelX, a_RelY, a_RelZ - 1, a_NewMeta); + SpreadToNeighbor(a_Chunk, a_RelX, a_RelY, a_RelZ + 1, a_NewMeta); +} + + + + bool cFloodyFluidSimulator::CheckTributaries(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_MyMeta) { // If we have a section above, check if there's fluid above this block that would feed it: |