diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-08-01 19:37:08 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-08-01 19:37:08 +0200 |
commit | bfe11024ac9bf202baa49a88d9370738ab0fcb8b (patch) | |
tree | 4a369f0b17cc6ed0ceed596e8df1da475be561d9 /src/Simulator | |
parent | Merge pull request #1272 from Howaner/Food (diff) | |
download | cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.tar cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.tar.gz cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.tar.bz2 cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.tar.lz cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.tar.xz cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.tar.zst cuberite-bfe11024ac9bf202baa49a88d9370738ab0fcb8b.zip |
Diffstat (limited to 'src/Simulator')
-rw-r--r-- | src/Simulator/FireSimulator.cpp | 20 |
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[] } |