fix: remove_floor clears only stand_on_floor, not stand_in_floor

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.
This commit is contained in:
2026-03-21 14:58:28 +00:00
parent 89693f968c
commit 2c92bdfe28
+5 -1
View File
@@ -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;
}