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:
+1
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user