diff options
author | Mattes D <github@xoft.cz> | 2014-05-31 10:12:54 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-31 10:12:54 +0200 |
commit | 0b758946ace41563a1763f557298879c894e56c2 (patch) | |
tree | 8ba9e2a3703c34ae317bd157f559bc72813805d9 /src/Simulator/FireSimulator.cpp | |
parent | Fixed bindings for cCompositeChat:SetMessageType(). (diff) | |
parent | Reduced the number of cChunkData::CopyBlockTypes() tests, added progress. (diff) | |
download | cuberite-0b758946ace41563a1763f557298879c894e56c2.tar cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.gz cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.bz2 cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.lz cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.xz cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.zst cuberite-0b758946ace41563a1763f557298879c894e56c2.zip |
Diffstat (limited to 'src/Simulator/FireSimulator.cpp')
-rw-r--r-- | src/Simulator/FireSimulator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index 4fbfffd43..311f8b4c4 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -95,8 +95,10 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun int NumMSecs = (int)a_Dt; for (cCoordWithIntList::iterator itr = Data.begin(); itr != Data.end();) { - int idx = cChunkDef::MakeIndexNoCheck(itr->x, itr->y, itr->z); - BLOCKTYPE BlockType = a_Chunk->GetBlock(idx); + int x = itr->x; + int y = itr->y; + int z = itr->z; + BLOCKTYPE BlockType = a_Chunk->GetBlock(x,y,z); if (!IsAllowedBlock(BlockType)) { @@ -125,7 +127,7 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun itr->x + a_ChunkX * cChunkDef::Width, itr->y, itr->z + a_ChunkZ * cChunkDef::Width ); */ - NIBBLETYPE BlockMeta = a_Chunk->GetMeta(idx); + NIBBLETYPE BlockMeta = a_Chunk->GetMeta(x, y, z); if (BlockMeta == 0x0f) { // The fire burnt out completely @@ -140,7 +142,7 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun if((itr->y > 0) && (!DoesBurnForever(a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z)))) { - a_Chunk->SetMeta(idx, BlockMeta + 1); + a_Chunk->SetMeta(x, y, z, BlockMeta + 1); } itr->Data = GetBurnStepTime(a_Chunk, itr->x, itr->y, itr->z); // TODO: Add some randomness into this } // for itr - Data[] |