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