Fixed door saying open bugs

This commit is contained in:
2026-02-07 13:34:12 +11:00
parent da544438e1
commit 72d0f5d576
3 changed files with 130 additions and 3 deletions

View File

@@ -119,7 +119,10 @@ function handleMove(w: World, actor: Actor, action: { dx: number; dy: number },
if (w.tiles[fromIdx] === TileType.DOOR_OPEN) {
const actorsLeft = accessor.getActorsAt(from.x, from.y);
if (actorsLeft.length === 0) {
console.log(`[simulation] Closing door at ${from.x},${from.y} - Actor ${actor.id} left`);
w.tiles[fromIdx] = TileType.DOOR_CLOSED;
} else {
console.log(`[simulation] Door at ${from.x},${from.y} stays open - ${actorsLeft.length} actors remain`);
}
}