summaryrefslogtreecommitdiffstats
path: root/src/Simulator/FloodyFluidSimulator.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:45:45 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:50:18 +0100
commitca6ef58b1ee8521e4b940ee4883dee714960e413 (patch)
tree8532add455224b07c07a759e3d906f50c0695888 /src/Simulator/FloodyFluidSimulator.cpp
parentMerge pull request #2972 from marvinkopf/PlayerAutoComplete (diff)
downloadcuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip
Diffstat (limited to 'src/Simulator/FloodyFluidSimulator.cpp')
-rw-r--r--src/Simulator/FloodyFluidSimulator.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp
index 518357f0b..afa54b2ad 100644
--- a/src/Simulator/FloodyFluidSimulator.cpp
+++ b/src/Simulator/FloodyFluidSimulator.cpp
@@ -54,7 +54,7 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re
a_Chunk->GetBlock(a_RelX, a_RelY, a_RelZ),
a_Chunk->GetMeta(a_RelX, a_RelY, a_RelZ)
);
-
+
BLOCKTYPE MyBlock; NIBBLETYPE MyMeta;
a_Chunk->GetBlockTypeMeta(a_RelX, a_RelY, a_RelZ, MyBlock, MyMeta);
@@ -108,7 +108,7 @@ void cFloodyFluidSimulator::SimulateBlock(cChunk * a_Chunk, int a_RelX, int a_Re
{
SpreadXZ(a_Chunk, a_RelX, a_RelY, a_RelZ, NewMeta);
}
-
+
// If source creation is on, check for it here:
if (
(m_NumNeighborsForSource > 0) && // Source creation is on
@@ -189,7 +189,7 @@ bool cFloodyFluidSimulator::CheckTributaries(cChunk * a_Chunk, int a_RelX, int a
}
} // for i - Coords[]
} // if not fed from above
-
+
// Block is not fed, decrease by m_Falloff levels:
if (a_MyMeta >= 8)
{
@@ -231,11 +231,11 @@ void cFloodyFluidSimulator::SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, i
const int BlockX = a_NearChunk->GetPosX() * cChunkDef::Width + a_RelX;
const int BlockZ = a_NearChunk->GetPosZ() * cChunkDef::Width + a_RelZ;
-
+
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
a_NearChunk->GetBlockTypeMeta(a_RelX, a_RelY, a_RelZ, BlockType, BlockMeta);
-
+
if (IsAllowedBlock(BlockType))
{
if ((BlockMeta == a_NewMeta) || IsHigherMeta(BlockMeta, a_NewMeta))
@@ -295,13 +295,13 @@ void cFloodyFluidSimulator::SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, i
{
ASSERT(!"Unknown fluid!");
}
-
+
if (!IsPassableForFluid(BlockType))
{
// Can't spread there
return;
}
-
+
// Wash away the block there, if possible:
if (CanWashAway(BlockType))
{
@@ -337,7 +337,7 @@ void cFloodyFluidSimulator::SpreadToNeighbor(cChunk * a_NearChunk, int a_RelX, i
bool cFloodyFluidSimulator::CheckNeighborsForSource(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
{
FLOG(" Checking neighbors for source creation");
-
+
static const Vector3i NeighborCoords[] =
{
Vector3i(-1, 0, 0),
@@ -345,7 +345,7 @@ bool cFloodyFluidSimulator::CheckNeighborsForSource(cChunk * a_Chunk, int a_RelX
Vector3i( 0, 0, -1),
Vector3i( 0, 0, 1),
} ;
-
+
int NumNeeded = m_NumNeighborsForSource;
for (size_t i = 0; i < ARRAYCOUNT(NeighborCoords); i++)
{