summaryrefslogtreecommitdiffstats
path: root/src/Simulator/FireSimulator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simulator/FireSimulator.cpp')
-rw-r--r--src/Simulator/FireSimulator.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index 69dc7164e..7ae84af7b 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -179,6 +179,17 @@ bool cFireSimulator::IsFuel(BLOCKTYPE a_BlockType)
case E_BLOCK_WOOL:
case E_BLOCK_BOOKCASE:
case E_BLOCK_FENCE:
+ case E_BLOCK_SPRUCE_FENCE:
+ case E_BLOCK_BIRCH_FENCE:
+ case E_BLOCK_JUNGLE_FENCE:
+ case E_BLOCK_DARK_OAK_FENCE:
+ case E_BLOCK_ACACIA_FENCE:
+ case E_BLOCK_FENCE_GATE:
+ case E_BLOCK_SPRUCE_FENCE_GATE:
+ case E_BLOCK_BIRCH_FENCE_GATE:
+ case E_BLOCK_JUNGLE_FENCE_GATE:
+ case E_BLOCK_DARK_OAK_FENCE_GATE:
+ case E_BLOCK_ACACIA_FENCE_GATE:
case E_BLOCK_TNT:
case E_BLOCK_VINES:
case E_BLOCK_HAY_BALE:
@@ -359,18 +370,26 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel
continue;
}
+ int AbsX = (Neighbour->GetPosX() * cChunkDef::Width) + X;
+ int Y = a_RelY + gNeighborCoords[i].y;
+ int AbsZ = (Neighbour->GetPosZ() * cChunkDef::Width) + Z;
+
if (BlockType == E_BLOCK_TNT)
{
- int AbsX = X + Neighbour->GetPosX() * cChunkDef::Width;
- int AbsZ = Z + Neighbour->GetPosZ() * cChunkDef::Width;
-
- m_World.SpawnPrimedTNT(AbsX, a_RelY + gNeighborCoords[i].y, AbsZ, 0);
- Neighbour->SetBlock(X, a_RelY + gNeighborCoords[i].y, Z, E_BLOCK_AIR, 0);
+ m_World.SpawnPrimedTNT(AbsX, Y, AbsZ, 0);
+ Neighbour->SetBlock(X, a_RelY + Y, Z, E_BLOCK_AIR, 0);
return;
}
bool ShouldReplaceFuel = (m_World.GetTickRandomNumber(MAX_CHANCE_REPLACE_FUEL) < m_ReplaceFuelChance);
- Neighbour->SetBlock(X, a_RelY + gNeighborCoords[i].y, Z, ShouldReplaceFuel ? E_BLOCK_FIRE : E_BLOCK_AIR, 0);
+ if (ShouldReplaceFuel && !cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, AbsX, Y, AbsZ, ssFireSpread))
+ {
+ Neighbour->SetBlock(X, Y, Z, E_BLOCK_FIRE, 0);
+ }
+ else
+ {
+ Neighbour->SetBlock(X, Y, Z, E_BLOCK_AIR, 0);
+ }
} // for i - Coords[]
}