diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-16 23:21:00 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-16 23:21:00 +0200 |
commit | 9194438fb552dc2f112535e2420d94de7af40e17 (patch) | |
tree | 3f5a6b96a4c3a8489e0b07f5796d650b46bbc046 /src/Simulator/IncrementalRedstoneSimulator.cpp | |
parent | Merge pull request #1192 from mc-server/skinuuid (diff) | |
download | cuberite-9194438fb552dc2f112535e2420d94de7af40e17.tar cuberite-9194438fb552dc2f112535e2420d94de7af40e17.tar.gz cuberite-9194438fb552dc2f112535e2420d94de7af40e17.tar.bz2 cuberite-9194438fb552dc2f112535e2420d94de7af40e17.tar.lz cuberite-9194438fb552dc2f112535e2420d94de7af40e17.tar.xz cuberite-9194438fb552dc2f112535e2420d94de7af40e17.tar.zst cuberite-9194438fb552dc2f112535e2420d94de7af40e17.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index fb5b01e17..55c5cbd09 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -2101,6 +2101,13 @@ bool cIncrementalRedstoneSimulator::QueueRepeaterPowerChange(int a_RelBlockX, in void cIncrementalRedstoneSimulator::SetSourceUnpowered(int a_SourceX, int a_SourceY, int a_SourceZ, cChunk * a_Chunk, bool a_IsFirstCall) { + if (!a_IsFirstCall) // The neighbouring chunks passed when this parameter is false may be invalid + { + if ((a_Chunk == NULL) || !a_Chunk->IsValid()) + { + return; + } + } // TODO: on C++11 support, change both of these to llama functions pased to a std::remove_if for (PoweredBlocksList::iterator itr = a_Chunk->GetRedstoneSimulatorPoweredBlocksList()->begin(); itr != a_Chunk->GetRedstoneSimulatorPoweredBlocksList()->end();) |