Changed some int parameters to vector parameters (#3937)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user