summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.inc
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 20:20:02 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-09-27 20:20:02 +0200
commit7b7225e50b43c8b4ac70680909892e79168ceaf5 (patch)
tree7c29be86ffc3f9c9644c202054a72bba016398a8 /src/Simulator/IncrementalRedstoneSimulator.inc
parentDropped support for <1.7.x (diff)
parentMerge pull request #1461 from mc-server/RedstoneFix (diff)
downloadcuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.tar
cuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.tar.gz
cuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.tar.bz2
cuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.tar.lz
cuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.tar.xz
cuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.tar.zst
cuberite-7b7225e50b43c8b4ac70680909892e79168ceaf5.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator.inc')
-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;