diff options
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp index c23af9f75..8063e72a4 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp @@ -217,12 +217,14 @@ void cIncrementalRedstoneSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position for (const auto & Offset : cSimulator::GetLinkedOffsets(a_Offset)) { auto Relative = a_Position - a_Offset + Offset; + if (!cChunkDef::IsValidHeight(Relative)) { continue; } - auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(Relative); + const auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(Relative); + if ((Chunk == nullptr) || !Chunk->IsValid()) { continue; |