From 104f9e127b259731836c2b88d74a8d731f3ad535 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Thu, 7 Sep 2017 10:25:34 +0200 Subject: Changed some int parameters to vector parameters (#3937) --- 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 45969bd0a..d5671c5c2 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -352,18 +352,18 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ) { - for (size_t i = 0; i < ARRAYCOUNT(gNeighborCoords); i++) + for (auto & Coord : gNeighborCoords) { BLOCKTYPE BlockType; - int X = a_RelX + gNeighborCoords[i].x; - int Z = a_RelZ + gNeighborCoords[i].z; + int X = a_RelX + Coord.x; + int Z = a_RelZ + Coord.z; cChunkPtr Neighbour = a_Chunk->GetRelNeighborChunkAdjustCoords(X, Z); if (Neighbour == nullptr) { continue; } - BlockType = Neighbour->GetBlock(X, a_RelY + gNeighborCoords[i].y, Z); + BlockType = Neighbour->GetBlock(X, a_RelY + Coord.y, Z); if (!IsFuel(BlockType)) { @@ -371,12 +371,12 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel } int AbsX = (Neighbour->GetPosX() * cChunkDef::Width) + X; - int Y = a_RelY + gNeighborCoords[i].y; + int Y = a_RelY + Coord.y; int AbsZ = (Neighbour->GetPosZ() * cChunkDef::Width) + Z; if (BlockType == E_BLOCK_TNT) { - m_World.SpawnPrimedTNT(AbsX, Y, AbsZ, 0); + m_World.SpawnPrimedTNT({static_cast(AbsX), static_cast(Y), static_cast(AbsZ)}, 0); Neighbour->SetBlock(X, Y, Z, E_BLOCK_AIR, 0); return; } -- cgit v1.2.3