diff options
author | Debucquoy Anthony tonitch <debucquoy.anthony@gmail.com> | 2022-06-18 02:09:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 02:09:58 +0200 |
commit | f089103c2b121f8128abfd6cdf0bd3cfbeca4465 (patch) | |
tree | 89c90001954484d22084cc68e29940cfe19e0e21 /src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp | |
parent | Remove redundant initialisations (diff) | |
download | cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.tar cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.tar.gz cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.tar.bz2 cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.tar.lz cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.tar.xz cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.tar.zst cuberite-f089103c2b121f8128abfd6cdf0bd3cfbeca4465.zip |
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; |