From 45a7bd190ad3b669b92d191af2746cd0b5f8b3d8 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 5 Mar 2024 14:51:40 +0300 Subject: [PATCH] world ceiling removed --- src/voxels/Chunks.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/voxels/Chunks.cpp b/src/voxels/Chunks.cpp index 229fccc9..ffc31939 100644 --- a/src/voxels/Chunks.cpp +++ b/src/voxels/Chunks.cpp @@ -55,8 +55,12 @@ const AABB* Chunks::isObstacleAt(float x, float y, float z){ int iz = floor(z); voxel* v = get(ix, iy, iz); if (v == nullptr) { - static const AABB empty; - return ∅ + if (iy >= CHUNK_H) { + return nullptr; + } else { + static const AABB empty; + return ∅ + } } const Block* def = contentIds->getBlockDef(v->id); if (def->obstacle) {