summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-16 23:21:00 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-16 23:21:00 +0200
commit9194438fb552dc2f112535e2420d94de7af40e17 (patch)
tree3f5a6b96a4c3a8489e0b07f5796d650b46bbc046 /src/Simulator/IncrementalRedstoneSimulator.cpp
parentMerge pull request #1192 from mc-server/skinuuid (diff)
downloadcuberite-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 'src/Simulator/IncrementalRedstoneSimulator.cpp')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp7
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();)