From 6aecd441141523505b4c732f8d8abd0ded305180 Mon Sep 17 00:00:00 2001 From: Daanish Date: Sun, 29 Mar 2026 11:20:10 +0000 Subject: [PATCH] Fix line of sight checks to use collision rectangle for prop interactions; as it caused the enemy to be able to softlock itself around a prop by thinking it was inside one the whole time; --- game/enemy/ai.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game/enemy/ai.rb b/game/enemy/ai.rb index 74e8fd7..23d39cc 100644 --- a/game/enemy/ai.rb +++ b/game/enemy/ai.rb @@ -25,10 +25,10 @@ class EnemyAI if player_tile == enemy_tile los_blocked = !prop_in_tile.nil? && !( - line_of_sight?(@enemy.x - @enemy.w / 2, @enemy.y - @enemy.h / 2, player_x, player_y, prop_in_tile.rect) && - line_of_sight?(@enemy.x + @enemy.w / 2, @enemy.y + @enemy.h / 2, player_x, player_y, prop_in_tile.rect) && - line_of_sight?(@enemy.x - @enemy.w / 2, @enemy.y + @enemy.h / 2, player_x, player_y, prop_in_tile.rect) && - line_of_sight?(@enemy.x + @enemy.w / 2, @enemy.y - @enemy.h / 2, player_x, player_y, prop_in_tile.rect) + line_of_sight?(@enemy.x - @enemy.w / 2, @enemy.y - @enemy.h / 2, player_x, player_y, prop_in_tile.collision_rect) && + line_of_sight?(@enemy.x + @enemy.w / 2, @enemy.y + @enemy.h / 2, player_x, player_y, prop_in_tile.collision_rect) && + line_of_sight?(@enemy.x - @enemy.w / 2, @enemy.y + @enemy.h / 2, player_x, player_y, prop_in_tile.collision_rect) && + line_of_sight?(@enemy.x + @enemy.w / 2, @enemy.y - @enemy.h / 2, player_x, player_y, prop_in_tile.collision_rect) ) if los_blocked