Fix projectiles and attacks passing through closed doors

Closed doors now block line of sight for both enemy AI and player
weapons. Previously, door tiles were excluded from collision checks,
allowing attacks through them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 21:34:13 +00:00
co-authored by Claude Opus 4.6
parent c55d7a7475
commit 86e0dda2d7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -229,7 +229,7 @@ class Enemy {
const checkY = Math.floor(this.y + stepY * i);
if (checkY >= 0 && checkY < map.length && checkX >= 0 && checkX < map[0].length) {
const cell = map[checkY][checkX];
if (cell > 0 && cell !== WALL_DOOR) return false;
if (cell > 0) return false;
}
}
return true;