summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Lyons Harkness <me@bearbin.net>2017-12-27 14:43:32 +0100
committerAlexander Lyons Harkness <me@bearbin.net>2017-12-27 14:43:32 +0100
commit14a2f4f24b205d7b944365114a1eca9ab4373093 (patch)
tree3357aa81d7d61a5a73660f8cc2e44ffa165cc3bc
parentimprove rain simulation (#4017) (diff)
downloadcuberite-issue4106.tar
cuberite-issue4106.tar.gz
cuberite-issue4106.tar.bz2
cuberite-issue4106.tar.lz
cuberite-issue4106.tar.xz
cuberite-issue4106.tar.zst
cuberite-issue4106.zip
-rw-r--r--src/Simulator/FireSimulator.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index ac7456b0a..67f881c27 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -147,16 +147,11 @@ void cFireSimulator::SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX,
continue;
}
- /*
- FLOG("FS: Fire at {%d, %d, %d} is stepping",
- itr->x + a_ChunkX * cChunkDef::Width, itr->y, itr->z + a_ChunkZ * cChunkDef::Width
- );
- */
// Has the fire burnt out?
if (BlockMeta == 0x0f)
{
FLOG("FS: Fire at {%d, %d, %d} burnt out, removing the fire block",
- itr->x + a_ChunkX * cChunkDef::Width, itr->y, itr->z + a_ChunkZ * cChunkDef::Width
+ AbsPos.x, AbsPos.y, AbsPos.z
);
a_Chunk->SetBlock(x, y, z, E_BLOCK_AIR, 0);
RemoveFuelNeighbors(a_Chunk, x, y, z);
@@ -350,22 +345,15 @@ void cFireSimulator::TrySpreadFire(cChunk * a_Chunk, int a_RelX, int a_RelY, int
}
// Start the fire in the neighbor {x, y, z}
- /*
- FLOG("FS: Trying to start fire at {%d, %d, %d}.",
- x + a_Chunk->GetPosX() * cChunkDef::Width, y, z + a_Chunk->GetPosZ() * cChunkDef::Width
- );
- */
if (CanStartFireInBlock(a_Chunk, x, y, z))
{
- 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, ssFireSpread))
+ auto AbsPos = cChunkDef::RelativeToAbsolute({x, y, z}, a_Chunk->GetPosX(), a_Chunk->GetPosZ());
+ if (cRoot::Get()->GetPluginManager()->CallHookBlockSpread(m_World, AbsPos.x, AbsPos.y, AbsPos.z, ssFireSpread))
{
return;
}
- FLOG("FS: Starting new fire at {%d, %d, %d}.", a_PosX, y, a_PosZ);
+ FLOG("FS: Starting new fire at {%d, %d, %d}.", AbsPos.x, AbsPos.y, AbsPos.z);
a_Chunk->UnboundedRelSetBlock(x, y, z, E_BLOCK_FIRE, 0);
}
} // for y