From 2c92bdfe28ce9439e80fac3133c1c564cc3ed7fb Mon Sep 17 00:00:00 2001 From: popertots Date: Sat, 21 Mar 2026 14:58:28 +0000 Subject: [PATCH] fix: remove_floor clears only stand_on_floor, not stand_in_floor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clearing stand_in_floor when removing a floor tile made the dug position impassable. An entity falling into the dug slot found (false || false) && true = false and kept falling. Now only stand_on_floor is cleared — the space reverts to air (passable), and only the tile above loses its platform. --- src/world/tiles/tilemap.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/world/tiles/tilemap.rs b/src/world/tiles/tilemap.rs index 52f4e52..092ceff 100644 --- a/src/world/tiles/tilemap.rs +++ b/src/world/tiles/tilemap.rs @@ -316,7 +316,11 @@ impl TileMap { let idx = ChunkData::pos_to_index(lx, ly, z); let word = idx / 32; let clear_mask = !(1u32 << (idx % 32)); - chunk.stand_in_floor[word] &= clear_mask; + // Only clear stand_on_floor. Removing a floor tile means the space becomes + // air — stand_in_floor should stay true so entities can pass through. + // Only stand_on_floor needs clearing: the tile above can no longer stand on + // a tile that doesn't exist. Clearing stand_in_floor made dug positions + // impassable, causing entities to fall through multiple levels. chunk.stand_on_floor[word] &= clear_mask; chunk.tile_ids[idx] = 0; }