handle_groups: don't look at other groups (enemy or own)
group_solve_combat: do nothing
unit_solve_combat: move command towards target unless ready to shoot and focus_fire() finds a target unit
focus_fire: ignore enemies that are out of attack range and further from the target than us
The effect is that units move towards the target attacking things on the way, but won't get stuck fighting or let enemies kite them away from the target.
The logic is
handle_groups
: don't look at other groups (enemy or own)group_solve_combat
: do nothingunit_solve_combat
: move command towards target unless ready to shoot and focus_fire() finds a target unitfocus_fire
: ignore enemies that are out of attack range and further from the target than usThe effect is that units move towards the target attacking things on the way, but won't get stuck fighting or let enemies kite them away from the target.