summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 19:06:26 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 19:06:26 +0200
commit28ebe11df27dec124202eb8ecaa47806f3db3096 (patch)
treea18b102c8dec6ef1df714747f364518ef5ba9a05 /src/Simulator
parentMerge pull request #1459 from Masy98/blocks (diff)
parentUpdate creatable.cpp (diff)
downloadcuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.tar
cuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.tar.gz
cuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.tar.bz2
cuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.tar.lz
cuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.tar.xz
cuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.tar.zst
cuberite-28ebe11df27dec124202eb8ecaa47806f3db3096.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc
index 6fda9824c..adaa47967 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.inc
+++ b/src/Simulator/IncrementalRedstoneSimulator.inc
@@ -77,7 +77,7 @@ private:
};
class cIncrementalRedstoneSimulatorChunkData :
- cRedstoneSimulatorChunkData
+ public cRedstoneSimulatorChunkData
{
public:
/// Per-chunk data for the simulator, specified individual chunks to simulate
@@ -554,6 +554,11 @@ template <class ChunkType, class WorldType, template <BLOCKTYPE block> class Get
void cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, ChunkType * a_Chunk)
{
m_RedstoneSimulatorChunkData = (cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData();
+ if (m_RedstoneSimulatorChunkData == NULL)
+ {
+ m_RedstoneSimulatorChunkData = new cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData();
+ a_Chunk->SetRedstoneSimulatorData(m_RedstoneSimulatorChunkData);
+ }
if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty())
{
return;