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/FireSimulator.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/FireSimulator.cpp')
-rw-r--r-- | src/Simulator/FireSimulator.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp index d1eb8618c..a025f6afd 100644 --- a/src/Simulator/FireSimulator.cpp +++ b/src/Simulator/FireSimulator.cpp @@ -363,14 +363,21 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, Vector3i a_RelPos) { for (auto & coord : gNeighborCoords) { - BLOCKTYPE BlockType; auto relPos = a_RelPos + coord; - auto neighbor = a_Chunk->GetRelNeighborChunkAdjustCoords(relPos); - if (neighbor == nullptr) + + if (!cChunkDef::IsValidHeight(relPos)) + { + continue; + } + + const auto neighbor = a_Chunk->GetRelNeighborChunkAdjustCoords(relPos); + + if ((neighbor == nullptr) || !neighbor->IsValid()) { continue; } - BlockType = neighbor->GetBlock(relPos); + + BLOCKTYPE BlockType = neighbor->GetBlock(relPos); if (!IsFuel(BlockType)) { |