From 9978d2876380526befc15bff0967c8fc42cb0d67 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 8 Oct 2026 14:29:47 +0200 Subject: [PATCH] PatrolOrbitsState: arrival advances the circuit only while the pilot is still on its task Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/ServerShared/Agents/Tasks/PatrolOrbits.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/ServerShared/Agents/Tasks/PatrolOrbits.cs b/Assets/Scripts/ServerShared/Agents/Tasks/PatrolOrbits.cs index f2a26771d..d6e0f009e 100644 --- a/Assets/Scripts/ServerShared/Agents/Tasks/PatrolOrbits.cs +++ b/Assets/Scripts/ServerShared/Agents/Tasks/PatrolOrbits.cs @@ -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)); } } \ No newline at end of file