summaryrefslogtreecommitdiffstats
path: root/src/Simulator/FireSimulator.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-12-06 11:41:37 +0100
committerMattes D <github@xoft.cz>2013-12-06 11:41:37 +0100
commitdde1c3a7cd326a142e6e21c799bfc3306c5cb350 (patch)
tree066134db5f8ecbca2f729a30dfb100fa1f02086d /src/Simulator/FireSimulator.cpp
parentAPIDump: Documented the new cPluginManager:GetCurrentPlugin() function. (diff)
parentI don't know how this dissapeard. (diff)
downloadcuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.tar
cuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.tar.gz
cuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.tar.bz2
cuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.tar.lz
cuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.tar.xz
cuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.tar.zst
cuberite-dde1c3a7cd326a142e6e21c799bfc3306c5cb350.zip
Diffstat (limited to '')
-rw-r--r--src/Simulator/FireSimulator.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index ac3fb9695..03e4f6e45 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -135,7 +135,11 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun
itr = Data.erase(itr);
continue;
}
- a_Chunk->SetMeta(idx, BlockMeta + 1);
+
+ if((itr->y > 0) && (!DoesBurnForever(a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z))))
+ {
+ 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 +180,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 +229,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;