summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-04-26 19:50:23 +0200
committerTycho <work.tycho+git@gmail.com>2014-04-26 19:50:23 +0200
commite40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0 (patch)
tree8cb2098da03ec8c2d66f8f36a53e4cf4280b554a /src/Simulator
parentReplaced all the .data() calls so the code compiles in VS2008 (diff)
downloadcuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.tar
cuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.tar.gz
cuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.tar.bz2
cuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.tar.lz
cuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.tar.xz
cuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.tar.zst
cuberite-e40f9d6e5b93e840e3d67e79f5ba49da1fbb75f0.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/FireSimulator.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index 470dfc791..4c1008897 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[]