summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
diff options
context:
space:
mode:
authorDebucquoy Anthony tonitch <debucquoy.anthony@gmail.com>2022-06-18 02:09:58 +0200
committerGitHub <noreply@github.com>2022-06-18 02:09:58 +0200
commitf089103c2b121f8128abfd6cdf0bd3cfbeca4465 (patch)
tree89c90001954484d22084cc68e29940cfe19e0e21 /src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
parentRemove redundant initialisations (diff)
downloadcuberite-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.cpp4
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;