From 221cc4ec5cb6301743e947eaabed3fecedba796f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 16 Oct 2019 10:06:34 +0200 Subject: Refactored block-to-pickup conversion. (#4417) --- src/Simulator/FireSimulator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Simulator/FireSimulator.cpp') diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 9a00d00a8..7862ed335 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -129,7 +129,7 @@ void cFireSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, // Randomly burn out the fire if it is raining: if (!BurnsForever && Raining && GetRandomProvider().RandBool(CHANCE_BASE_RAIN_EXTINGUISH + (BlockMeta * CHANCE_AGE_M_RAIN_EXTINGUISH))) { - a_Chunk->SetBlock(x, y, z, E_BLOCK_AIR, 0); + a_Chunk->SetBlock({x, y, z}, E_BLOCK_AIR, 0); itr = Data.erase(itr); continue; } @@ -157,7 +157,7 @@ void cFireSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, FIRE_FLOG("FS: Fire at {0} burnt out, removing the fire block", a_Chunk->PositionToWorldPosition({itr->x, itr->y, itr->z}) ); - a_Chunk->SetBlock(x, y, z, E_BLOCK_AIR, 0); + a_Chunk->SetBlock({x, y, z}, E_BLOCK_AIR, 0); RemoveFuelNeighbors(a_Chunk, x, y, z); itr = Data.erase(itr); continue; @@ -314,7 +314,7 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in // Checked through everything, nothing was flammable // If block below isn't solid, we can't have fire, it would be a non-fueled fire // SetBlock just to make sure fire doesn't spawn - a_Chunk->SetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_AIR, 0); + a_Chunk->SetBlock({a_RelX, a_RelY, a_RelZ}, E_BLOCK_AIR, 0); return 0; } return static_cast(m_BurnStepTimeNonfuel); @@ -403,18 +403,18 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel if (BlockType == E_BLOCK_TNT) { m_World.SpawnPrimedTNT({static_cast(AbsX), static_cast(Y), static_cast(AbsZ)}, 0); - Neighbour->SetBlock(X, Y, Z, E_BLOCK_AIR, 0); + Neighbour->SetBlock({X, Y, Z}, E_BLOCK_AIR, 0); return; } bool ShouldReplaceFuel = (GetRandomProvider().RandBool(m_ReplaceFuelChance * (1.0 / MAX_CHANCE_REPLACE_FUEL))); if (ShouldReplaceFuel && !cRoot::Get()->GetPluginManager()->CallHookBlockSpread(m_World, AbsX, Y, AbsZ, ssFireSpread)) { - Neighbour->SetBlock(X, Y, Z, E_BLOCK_FIRE, 0); + Neighbour->SetBlock({X, Y, Z}, E_BLOCK_FIRE, 0); } else { - Neighbour->SetBlock(X, Y, Z, E_BLOCK_AIR, 0); + Neighbour->SetBlock({X, Y, Z}, E_BLOCK_AIR, 0); } } // for i - Coords[] } -- cgit v1.2.3