summaryrefslogtreecommitdiffstats
path: root/src/Simulator/SimulatorManager.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-05 09:35:10 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-05 09:35:37 +0200
commitd2156aab7cf25383c8f893e6222c89dcf5c17aa4 (patch)
tree06d76192d34ee1dd3d5cbbdb6210d707d5c339f4 /src/Simulator/SimulatorManager.cpp
parentDelete unreferenced variable (diff)
downloadcuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.tar
cuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.tar.gz
cuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.tar.bz2
cuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.tar.lz
cuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.tar.xz
cuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.tar.zst
cuberite-d2156aab7cf25383c8f893e6222c89dcf5c17aa4.zip
Diffstat (limited to 'src/Simulator/SimulatorManager.cpp')
-rw-r--r--src/Simulator/SimulatorManager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Simulator/SimulatorManager.cpp b/src/Simulator/SimulatorManager.cpp
index 07b4a7214..81044d705 100644
--- a/src/Simulator/SimulatorManager.cpp
+++ b/src/Simulator/SimulatorManager.cpp
@@ -71,8 +71,12 @@ void cSimulatorManager::WakeUp(cChunk & a_Chunk, Vector3i a_Position)
for (const auto Offset : cSimulator::AdjacentOffsets)
{
auto Relative = a_Position + Offset;
- auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(Relative);
+ if (!cChunkDef::IsValidHeight(Relative.y))
+ {
+ continue;
+ }
+ auto Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(Relative);
if ((Chunk == nullptr) || !Chunk->IsValid())
{
continue;