summaryrefslogtreecommitdiffstats
path: root/src/Simulator/FireSimulator.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2017-09-07 10:25:34 +0200
committerMattes D <github@xoft.cz>2017-09-07 10:25:34 +0200
commit104f9e127b259731836c2b88d74a8d731f3ad535 (patch)
tree0aa333690caf9480f38e2ec1a88265b84544aeb5 /src/Simulator/FireSimulator.cpp
parentAdd cWorld::RemoveEntity and use in cEntity (#4003) (diff)
downloadcuberite-104f9e127b259731836c2b88d74a8d731f3ad535.tar
cuberite-104f9e127b259731836c2b88d74a8d731f3ad535.tar.gz
cuberite-104f9e127b259731836c2b88d74a8d731f3ad535.tar.bz2
cuberite-104f9e127b259731836c2b88d74a8d731f3ad535.tar.lz
cuberite-104f9e127b259731836c2b88d74a8d731f3ad535.tar.xz
cuberite-104f9e127b259731836c2b88d74a8d731f3ad535.tar.zst
cuberite-104f9e127b259731836c2b88d74a8d731f3ad535.zip
Diffstat (limited to 'src/Simulator/FireSimulator.cpp')
-rw-r--r--src/Simulator/FireSimulator.cpp12
1 files changed, 6 insertions, 6 deletions
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<double>(AbsX), static_cast<double>(Y), static_cast<double>(AbsZ)}, 0);
Neighbour->SetBlock(X, Y, Z, E_BLOCK_AIR, 0);
return;
}