diff options
author | madmaxoft <github@xoft.cz> | 2013-10-09 09:09:47 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-09 09:09:47 +0200 |
commit | 36f24e30b749ed015c796812fb474122657490a0 (patch) | |
tree | 374ce6c2f4643828fde1b509f198806f356d67cf /source/Simulator | |
parent | Merge branch 'magicalcarpets' of git://github.com/tigerw/MCServer into tigerw-magicalcarpets (diff) | |
download | cuberite-36f24e30b749ed015c796812fb474122657490a0.tar cuberite-36f24e30b749ed015c796812fb474122657490a0.tar.gz cuberite-36f24e30b749ed015c796812fb474122657490a0.tar.bz2 cuberite-36f24e30b749ed015c796812fb474122657490a0.tar.lz cuberite-36f24e30b749ed015c796812fb474122657490a0.tar.xz cuberite-36f24e30b749ed015c796812fb474122657490a0.tar.zst cuberite-36f24e30b749ed015c796812fb474122657490a0.zip |
Diffstat (limited to 'source/Simulator')
-rw-r--r-- | source/Simulator/FireSimulator.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source/Simulator/FireSimulator.cpp b/source/Simulator/FireSimulator.cpp index da1dc8d15..ac3fb9695 100644 --- a/source/Simulator/FireSimulator.cpp +++ b/source/Simulator/FireSimulator.cpp @@ -221,6 +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) { + bool IsBlockBelowSolid = false; if (a_RelY > 0) { BLOCKTYPE BlockBelow = a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ); @@ -233,6 +234,7 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in { return m_BurnStepTimeFuel; } + IsBlockBelowSolid = g_BlockIsSolid[BlockBelow]; } for (int i = 0; i < ARRAYCOUNT(gCrossCoords); i++) @@ -248,22 +250,15 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in } } // for i - gCrossCoords[] - if ((a_RelY > 0) && (a_RelY < cChunkDef::Height - 1)) + if (!IsBlockBelowSolid && (a_RelY >= 0)) { // 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->SetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_AIR, 0); - return 0; - } + // If block below isn't solid, we can't have fire, it would be a non-fueled fire + // SetBlock just to make sure fire doesn't spawn + a_Chunk->SetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_AIR, 0); + return 0; } + return m_BurnStepTimeNonfuel; } |