diff options
author | worktycho <work.tycho@gmail.com> | 2014-09-27 15:49:03 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-09-27 15:49:03 +0200 |
commit | 94a0d04d58110d3a54669c0b7bbb7f0a618a60bd (patch) | |
tree | 851be03e9ea282b5c48f7e3b2360a256336dce1a /src/Simulator/IncrementalRedstoneSimulator.inc | |
parent | Add data accessor. (diff) | |
download | cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.tar cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.tar.gz cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.tar.bz2 cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.tar.lz cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.tar.xz cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.tar.zst cuberite-94a0d04d58110d3a54669c0b7bbb7f0a618a60bd.zip |
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator.inc')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc index 6fda9824c..ba67d4014 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.inc +++ b/src/Simulator/IncrementalRedstoneSimulator.inc @@ -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->SetRedstoneChunkData(m_RedstoneSimulatorChunkData); + } if (m_RedstoneSimulatorChunkData->m_ChunkData.empty() && ((cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_QueuedChunkData.empty()) { return; |