summaryrefslogtreecommitdiffstats
path: root/source/Simulator/FireSimulator.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-09-30 00:39:58 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-09-30 00:39:58 +0200
commitab34da78e7ef249acb01924cf184b7c1fba2ab3a (patch)
treede16b79cc61b4db844d74a974e1686c09d38156d /source/Simulator/FireSimulator.cpp
parentMerge pull request #2 from tigerw/bugfixes (diff)
downloadcuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.tar
cuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.tar.gz
cuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.tar.bz2
cuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.tar.lz
cuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.tar.xz
cuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.tar.zst
cuberite-ab34da78e7ef249acb01924cf184b7c1fba2ab3a.zip
Diffstat (limited to '')
-rw-r--r--source/Simulator/FireSimulator.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/source/Simulator/FireSimulator.cpp b/source/Simulator/FireSimulator.cpp
index 587f45306..e0b4f1f02 100644
--- a/source/Simulator/FireSimulator.cpp
+++ b/source/Simulator/FireSimulator.cpp
@@ -221,7 +221,7 @@ void cFireSimulator::AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk *
int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
{
- if (a_RelY > 0)
+ if ((a_RelY > 0) && (a_RelY < cChunkDef::Height - 1))
{
BLOCKTYPE BlockBelow = a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ);
if (IsForever(BlockBelow))
@@ -234,10 +234,6 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in
return m_BurnStepTimeFuel;
}
}
- if ((a_RelY < cChunkDef::Height - 1) && IsFuel(a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ)))
- {
- return m_BurnStepTimeFuel;
- }
for (int i = 0; i < ARRAYCOUNT(gCrossCoords); i++)
{
@@ -251,7 +247,23 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in
}
}
} // for i - gCrossCoords[]
- return m_BurnStepTimeNonfuel;
+
+ if ((a_RelY > 0) && (a_RelY < cChunkDef::Height - 1))
+ {
+ // Checked through everything, nothing was flammable
+ // If block below isn't solid, we can't have fire, otherwise, we have non-fueled fire
+ BLOCKTYPE BlockBelow = a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ);
+ if (g_BlockIsSolid[BlockBelow])
+ {
+ return m_BurnStepTimeNonfuel;
+ }
+ else
+ {
+ // SetBlock just to make sure fire doesn't spawn
+ a_Chunk->UnboundedRelSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_AIR, 0);
+ return 0;
+ }
+ }
}