From 86e0dda2d7e1fb34ee03ec90588c4990fa77d561 Mon Sep 17 00:00:00 2001 From: Adam Harrison-Fuller Date: Mon, 16 Mar 2026 21:34:13 +0000 Subject: [PATCH] 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 --- js/enemies.js | 2 +- js/weapons.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/enemies.js b/js/enemies.js index 61cebd9..4291548 100644 --- a/js/enemies.js +++ b/js/enemies.js @@ -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; diff --git a/js/weapons.js b/js/weapons.js index b930616..cb984e2 100644 --- a/js/weapons.js +++ b/js/weapons.js @@ -160,7 +160,7 @@ class WeaponSystem { const checkX = Math.floor(player.x + stepX * i); const checkY = Math.floor(player.y + stepY * i); if (checkY >= 0 && checkY < map.length && checkX >= 0 && checkX < map[0].length) { - if (map[checkY][checkX] > 0 && map[checkY][checkX] !== WALL_DOOR) { + if (map[checkY][checkX] > 0) { return true; } }