Fixed door saying open bugs
This commit is contained in:
@@ -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`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user