summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Simulator/FireSimulator.cpp16
-rw-r--r--src/Simulator/FireSimulator.h4
2 files changed, 15 insertions, 5 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index ac3fb9695..8e46ed320 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -135,7 +135,17 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun
itr = Data.erase(itr);
continue;
}
- a_Chunk->SetMeta(idx, BlockMeta + 1);
+
+ BLOCKTYPE Burnee = E_BLOCK_AIR;
+ if (itr->y > 0)
+ {
+ Burnee = a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z);
+ }
+
+ if(!DoesBurnForever(Burnee))
+ {
+ a_Chunk->SetMeta(idx, BlockMeta + 1);
+ }
itr->Data = GetBurnStepTime(a_Chunk, itr->x, itr->y, itr->z); // TODO: Add some randomness into this
} // for itr - Data[]
}
@@ -176,7 +186,7 @@ bool cFireSimulator::IsFuel(BLOCKTYPE a_BlockType)
-bool cFireSimulator::IsForever(BLOCKTYPE a_BlockType)
+bool cFireSimulator::DoesBurnForever(BLOCKTYPE a_BlockType)
{
return (a_BlockType == E_BLOCK_NETHERRACK);
}
@@ -225,7 +235,7 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in
if (a_RelY > 0)
{
BLOCKTYPE BlockBelow = a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ);
- if (IsForever(BlockBelow))
+ if (DoesBurnForever(BlockBelow))
{
// Is burning atop of netherrack, burn forever (re-check in 10 sec)
return 10000;
diff --git a/src/Simulator/FireSimulator.h b/src/Simulator/FireSimulator.h
index a788ed327..59cc62540 100644
--- a/src/Simulator/FireSimulator.h
+++ b/src/Simulator/FireSimulator.h
@@ -27,8 +27,8 @@ public:
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override;
- static bool IsFuel (BLOCKTYPE a_BlockType);
- static bool IsForever(BLOCKTYPE a_BlockType);
+ bool IsFuel (BLOCKTYPE a_BlockType);
+ bool DoesBurnForever(BLOCKTYPE a_BlockType);
protected:
/// Time (in msec) that a fire block takes to burn with a fuel block into the next step