Merge pull request #394 from SamJBarney/master
Fire no longer goes out when on top of nether rack
This commit is contained in:
commit
dde1c3a7cd
@ -1 +1 @@
|
|||||||
Subproject commit da272372406e0990235b008dba73b7bfbda040e8
|
Subproject commit 52e1de4332a026e58fda843aae98c1f51e57199e
|
@ -135,7 +135,11 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun
|
|||||||
itr = Data.erase(itr);
|
itr = Data.erase(itr);
|
||||||
continue;
|
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
|
itr->Data = GetBurnStepTime(a_Chunk, itr->x, itr->y, itr->z); // TODO: Add some randomness into this
|
||||||
} // for itr - Data[]
|
} // 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);
|
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)
|
if (a_RelY > 0)
|
||||||
{
|
{
|
||||||
BLOCKTYPE BlockBelow = a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ);
|
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)
|
// Is burning atop of netherrack, burn forever (re-check in 10 sec)
|
||||||
return 10000;
|
return 10000;
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override;
|
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override;
|
||||||
|
|
||||||
static bool IsFuel (BLOCKTYPE a_BlockType);
|
static bool IsFuel (BLOCKTYPE a_BlockType);
|
||||||
static bool IsForever(BLOCKTYPE a_BlockType);
|
static bool DoesBurnForever(BLOCKTYPE a_BlockType);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Time (in msec) that a fire block takes to burn with a fuel block into the next step
|
/// Time (in msec) that a fire block takes to burn with a fuel block into the next step
|
||||||
|
Loading…
Reference in New Issue
Block a user