From 4b7891f2903998892287b4a98d5f69e0bb4ce58c Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 20 Feb 2014 17:56:35 +0100 Subject: Add Hay Bale to Burnable --- src/Simulator/FireSimulator.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index d7c5ab3b4..b77fa1658 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -169,6 +169,7 @@ bool cFireSimulator::IsFuel(BLOCKTYPE a_BlockType) case E_BLOCK_FENCE: case E_BLOCK_TNT: case E_BLOCK_VINES: + case E_BLOCK_HAY_BALE: { return true; } -- cgit v1.2.3 From 66c84250410bf24bc689436c570c284bc47e3638 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 28 Feb 2014 15:26:32 +0100 Subject: Fix Double Slabs, fix Slab Meta and add more things to burnable --- src/Simulator/FireSimulator.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index b77fa1658..85190c82b 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -162,14 +162,27 @@ bool cFireSimulator::IsFuel(BLOCKTYPE a_BlockType) switch (a_BlockType) { case E_BLOCK_PLANKS: + case E_BLOCK_DOUBLE_WOODEN_SLAB: + case E_BLOCK_WOODEN_SLAB: + case E_BLOCK_WOODEN_STAIRS: + case E_BLOCK_SPRUCE_WOOD_STAIRS: + case E_BLOCK_BIRCH_WOOD_STAIRS: + case E_BLOCK_JUNGLE_WOOD_STAIRS: case E_BLOCK_LEAVES: + case E_BLOCK_NEW_LEAVES: case E_BLOCK_LOG: + case E_BLOCK_NEW_LOG: case E_BLOCK_WOOL: case E_BLOCK_BOOKCASE: case E_BLOCK_FENCE: case E_BLOCK_TNT: case E_BLOCK_VINES: case E_BLOCK_HAY_BALE: + case E_BLOCK_TALL_GRASS: + case E_BLOCK_BIG_FLOWER: + case E_BLOCK_DANDELION: + case E_BLOCK_FLOWER: + case E_BLOCK_CARPET: { return true; } -- cgit v1.2.3 From d73cdba1f66a92f011ac881b581595c0959139ef Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 1 Mar 2014 21:34:19 +0200 Subject: g_BlockXXX => cBlockInfo::XXX --- src/Simulator/FireSimulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index b77fa1658..6aef97079 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -239,7 +239,7 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in { return m_BurnStepTimeFuel; } - IsBlockBelowSolid = g_BlockIsSolid[BlockBelow]; + IsBlockBelowSolid = cBlockInfo::IsSolid(BlockBelow); } for (size_t i = 0; i < ARRAYCOUNT(gCrossCoords); i++) -- cgit v1.2.3 From ff186f9735bd08727d6d010e6815c103b2e181e8 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 9 Mar 2014 01:23:55 +0000 Subject: TNT explodes when consumed by fire Fixed FS#406 --- src/Simulator/FireSimulator.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 4967c83f9..6079ea740 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -335,20 +335,33 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel { BLOCKTYPE BlockType; NIBBLETYPE BlockMeta; - if (!a_Chunk->UnboundedRelGetBlock(a_RelX + gNeighborCoords[i].x, a_RelY + gNeighborCoords[i].y, a_RelZ + gNeighborCoords[i].z, BlockType, BlockMeta)) + int X = a_RelX + gNeighborCoords[i].x; + int Z = a_RelZ + gNeighborCoords[i].z; + + cChunkPtr Neighbour = a_Chunk->GetRelNeighborChunkAdjustCoords(X, Z); + if (Neighbour == NULL) { - // Neighbor not accessible, ignore it continue; } + Neighbour->GetBlockTypeMeta(X, a_RelY + gCrossCoords[i].y, Z, BlockType, BlockMeta); + if (!IsFuel(BlockType)) { continue; } + + 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); + return; + } + bool ShouldReplaceFuel = (m_World.GetTickRandomNumber(MAX_CHANCE_REPLACE_FUEL) < m_ReplaceFuelChance); - a_Chunk->UnboundedRelSetBlock( - a_RelX + gNeighborCoords[i].x, a_RelY + gNeighborCoords[i].y, a_RelZ + gNeighborCoords[i].z, - ShouldReplaceFuel ? E_BLOCK_FIRE : E_BLOCK_AIR, 0 - ); + Neighbour->SetBlock(X, a_RelY + gNeighborCoords[i].y, Z, ShouldReplaceFuel ? E_BLOCK_FIRE : E_BLOCK_AIR, 0); } // for i - Coords[] } -- cgit v1.2.3 From 0f412a0a022b75823561c2f78e5f0c9469b0d1b4 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 9 Mar 2014 21:48:18 +0000 Subject: Removed uneeded meta obtain --- src/Simulator/FireSimulator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 6079ea740..31cc0b670 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -1,4 +1,3 @@ - #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "FireSimulator.h" @@ -334,7 +333,6 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel for (size_t i = 0; i < ARRAYCOUNT(gNeighborCoords); i++) { BLOCKTYPE BlockType; - NIBBLETYPE BlockMeta; int X = a_RelX + gNeighborCoords[i].x; int Z = a_RelZ + gNeighborCoords[i].z; @@ -343,7 +341,7 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel { continue; } - Neighbour->GetBlockTypeMeta(X, a_RelY + gCrossCoords[i].y, Z, BlockType, BlockMeta); + BlockType = Neighbour->GetBlockTypeMeta(X, a_RelY + gCrossCoords[i].y, Z); if (!IsFuel(BlockType)) { -- cgit v1.2.3 From b2733fad220243a631f9625cc84a50b70b6f43de Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 10 Mar 2014 18:23:12 +0000 Subject: Fixed compile --- src/Simulator/FireSimulator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 31cc0b670..26712e6e6 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -1,3 +1,4 @@ + #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "FireSimulator.h" @@ -341,7 +342,7 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel { continue; } - BlockType = Neighbour->GetBlockTypeMeta(X, a_RelY + gCrossCoords[i].y, Z); + BlockType = Neighbour->GetBlock(X, a_RelY + gCrossCoords[i].y, Z); if (!IsFuel(BlockType)) { -- cgit v1.2.3 From c4a8336e847d2f4731dd9d899d6af200631f8aef Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 16 Mar 2014 14:38:41 +0100 Subject: Add HOOK_BLOCK_SPREAD --- src/Simulator/FireSimulator.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 26712e6e6..871a1ec5c 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -6,6 +6,8 @@ #include "../BlockID.h" #include "../Defines.h" #include "../Chunk.h" +#include "Root.h" +#include "PluginManager.h" @@ -315,9 +317,15 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int */ if (CanStartFireInBlock(a_Chunk, x, y, z)) { - FLOG("FS: Starting new fire at {%d, %d, %d}.", - x + a_Chunk->GetPosX() * cChunkDef::Width, y, z + a_Chunk->GetPosZ() * cChunkDef::Width - ); + int a_PosX = x + a_Chunk->GetPosX() * cChunkDef::Width; + int a_PosZ = z + a_Chunk->GetPosZ() * cChunkDef::Width; + + if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, a_PosX, y, a_PosZ)) + { + return; + } + + FLOG("FS: Starting new fire at {%d, %d, %d}.", a_PosX, y, a_PosZ); a_Chunk->UnboundedRelSetBlock(x, y, z, E_BLOCK_FIRE, 0); } } // for y -- cgit v1.2.3 From 3774b1be6445257a28677fbdce17bab58c168df9 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 16 Mar 2014 16:06:03 +0100 Subject: Add SpreadSource --- src/Simulator/FireSimulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 871a1ec5c..932ccf6bd 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -320,7 +320,7 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int int a_PosX = x + a_Chunk->GetPosX() * cChunkDef::Width; int a_PosZ = z + a_Chunk->GetPosZ() * cChunkDef::Width; - if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, a_PosX, y, a_PosZ)) + if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, a_PosX, y, a_PosZ, esFireSpread)) { return; } -- cgit v1.2.3 From 9c461124866cd16d04206f49da6650a2219de50f Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 16 Mar 2014 22:28:12 +0100 Subject: Change SpreadSource prefix to ss --- src/Simulator/FireSimulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 932ccf6bd..e4d4a540d 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -320,7 +320,7 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int int a_PosX = x + a_Chunk->GetPosX() * cChunkDef::Width; int a_PosZ = z + a_Chunk->GetPosZ() * cChunkDef::Width; - if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, a_PosX, y, a_PosZ, esFireSpread)) + if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(&m_World, a_PosX, y, a_PosZ, ssFireSpread)) { return; } -- cgit v1.2.3 From 1802234b4ab58d1afc258a40341e54484c045899 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 28 Mar 2014 16:44:12 +0100 Subject: Fixed compilation after last PR merge. --- src/Simulator/FireSimulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index e4d4a540d..470dfc791 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -7,7 +7,7 @@ #include "../Defines.h" #include "../Chunk.h" #include "Root.h" -#include "PluginManager.h" +#include "../Bindings/PluginManager.h" -- cgit v1.2.3