From bfe11024ac9bf202baa49a88d9370738ab0fcb8b Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 1 Aug 2014 19:37:08 +0200 Subject: Added missing HOOK_BLOCK_SPREAD call. --- src/Simulator/FireSimulator.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/Simulator/FireSimulator.cpp') 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[] } -- cgit v1.2.3 From 5f2e850b0f1650006a8b06578c18ec6bc03d9b37 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Thu, 11 Sep 2014 15:48:26 +0200 Subject: Added blocks to the fire simulator --- src/Simulator/FireSimulator.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index cdb5abde2..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: -- cgit v1.2.3