PatrolOrbitsState: arrival advances the circuit only while the pilot is still on its task

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-08 14:29:47 +02:00
commit 9978d28763

View file

@ -27,6 +27,7 @@ public class PatrolOrbitsState : BaseState
Transitions.Add(new StateTransition(patrolMoveState,
() => true,
() => patrolMoveState.Orbit = CurrentTarget));
patrolMoveState.Transitions.Add(new StateTransition(this, () => patrolMoveState.Distance < 10, NextTarget));
// Arrival advances the circuit only while the pilot is still on this task: a task change leaves the patrol first.
patrolMoveState.Transitions.Add(new StateTransition(this, () => patrolMoveState.Distance < 10 && agent.Task == Task, NextTarget));
}
}