summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-01 22:30:44 +0200
committerMattes D <github@xoft.cz>2014-08-01 22:30:44 +0200
commit00dace910fce8fa604b47b094424beeb3a0fc89d (patch)
tree4a369f0b17cc6ed0ceed596e8df1da475be561d9
parentMerge pull request #1272 from Howaner/Food (diff)
parentAdded missing HOOK_BLOCK_SPREAD call. (diff)
downloadcuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.tar
cuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.tar.gz
cuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.tar.bz2
cuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.tar.lz
cuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.tar.xz
cuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.tar.zst
cuberite-00dace910fce8fa604b47b094424beeb3a0fc89d.zip
-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[]
}