From 290b34331a20bf5a96ba22c3aa5faf57ded8e621 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 8 Oct 2026 16:20:33 +0200 Subject: [PATCH] Minion: a task change leaves its own state only; the walk no longer crosses into the other task's states Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/ServerShared/Agents/Minion.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/ServerShared/Agents/Minion.cs b/Assets/Scripts/ServerShared/Agents/Minion.cs index 80ee3c34f..41c0e3fe1 100644 --- a/Assets/Scripts/ServerShared/Agents/Minion.cs +++ b/Assets/Scripts/ServerShared/Agents/Minion.cs @@ -14,11 +14,11 @@ public class Minion : Agent _rootState.AddTransition(followState, () => Task is FollowTask); // A Task change switches the substate in one update, from wherever the pilot is in the old task. includeChildren - // reaches the sub-states (MoveToOrbit) that Update actually sits in. + // reaches the patrol sub-states (MoveToOrbit) that Update actually sits in; the walk never enters the other task's state. patrolState.AddTransition(followState, () => Task is FollowTask, null, true, _rootState); - followState.AddTransition(patrolState, () => Task is PatrolOrbitsTask, Patrol, true, _rootState); - patrolState.AddTransition(_rootState, () => !(Task is PatrolOrbitsTask), null, true, _rootState); - followState.AddTransition(_rootState, () => !(Task is FollowTask), null, true, _rootState); + patrolState.AddTransition(_rootState, () => !(Task is PatrolOrbitsTask), null, true, _rootState, followState); + followState.AddTransition(patrolState, () => Task is PatrolOrbitsTask, Patrol); + followState.AddTransition(_rootState, () => !(Task is FollowTask)); var combatState = new CombatState(this); _rootState.AddTransition(combatState,