diff options
author | madmaxoft <github@xoft.cz> | 2014-09-27 22:24:49 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-09-27 22:25:07 +0200 |
commit | 03791b1e632e8494ba5e261f430d8a8d91a599b8 (patch) | |
tree | 0ec199c9ebf2de296c25bac7ee66d63a0590d1c0 /src/Simulator | |
parent | Merge pull request #1465 from Masy98/blocks (diff) | |
download | cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.tar cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.tar.gz cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.tar.bz2 cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.tar.lz cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.tar.xz cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.tar.zst cuberite-03791b1e632e8494ba5e261f430d8a8d91a599b8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.inc b/src/Simulator/IncrementalRedstoneSimulator.inc index adaa47967..937e6b790 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.inc +++ b/src/Simulator/IncrementalRedstoneSimulator.inc @@ -408,7 +408,12 @@ void cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, // Every time a block is changed (AddBlock called), we want to go through all lists and check to see if the coordiantes stored within are still valid // Checking only when a block is changed, as opposed to every tick, also improves performance - PoweredBlocksList & PoweredBlocks = ((cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData())->m_PoweredBlocks; + cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData * SimulatorChunkData = ((cIncrementalRedstoneSimulator<ChunkType, WorldType, GetHandlerCompileTime, ChestType>::cIncrementalRedstoneSimulatorChunkData *)a_Chunk->GetRedstoneSimulatorData()); + if (SimulatorChunkData == NULL) + { + return; + } + PoweredBlocksList & PoweredBlocks = SimulatorChunkData->m_PoweredBlocks; for (typename PoweredBlocksList::iterator itr = PoweredBlocks.begin(); itr != PoweredBlocks.end();) { if (!itr->a_SourcePos.Equals(Vector3i(a_BlockX, a_BlockY, a_BlockZ))) |