summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Simulator/FireSimulator.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index 69dc7164e..cdb5abde2 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -359,18 +359,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[]
}