From 55ebae40582d8ae1e2baa2961b4b95f1029c7216 Mon Sep 17 00:00:00 2001 From: Forrest Date: Tue, 6 Oct 2026 13:22:21 -0400 Subject: [PATCH] Thieves go straight for loose loot in clear view, however far With #21's animals roaming the whole (now 60 x 80) farm, an animal thief whose loose target was beyond direct_seek_distance followed the pen's flow field away from it and gave up after 10 s. Loot away from home has no home area to head for, so any clear line to it now counts. Fixes test_roster "a thief walks in through the gap it opened and takes an animal" on the merged #20 + #21 tree. Co-Authored-By: Claude Opus 5.5 --- game/scripts/thief_behavior.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/game/scripts/thief_behavior.gd b/game/scripts/thief_behavior.gd index e0c732e..bffc105 100644 --- a/game/scripts/thief_behavior.gd +++ b/game/scripts/thief_behavior.gd @@ -238,7 +238,10 @@ func _seek(es: EnemySystem, i: int, dt: float) -> void: return es.pace[i] = 1.0 var field := field_for(unit) - if (area_for(loot.category[unit], goal).has_point(p) or d < cfg.direct_seek_distance) and nav.line_clear(p.x, p.y, goal.x, goal.y): + # Loot away from home (a loose animal roaming the farm, a dropped item) has no home area to + # head for, so any clear line to it will do, however far. + var near := not loot.is_home(unit) or area_for(loot.category[unit], goal).has_point(p) or d < cfg.direct_seek_distance + if near and nav.line_clear(p.x, p.y, goal.x, goal.y): es.desire_x[i] = to.x / d es.desire_z[i] = to.y / d es.timer[i] = 0.0