From 7217112873554d4ecd88d4a09c9ef634cfce15cf Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 8 Oct 2026 16:21:37 +0200 Subject: [PATCH] FlightTests: a patrolling pilot never falls back to the root state Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/FlightTests.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/FlightTests.cs b/tests/Aetheria.Shared.Tests/FlightTests.cs index bf48be987..d48e9466c 100644 --- a/tests/Aetheria.Shared.Tests/FlightTests.cs +++ b/tests/Aetheria.Shared.Tests/FlightTests.cs @@ -235,6 +235,20 @@ public sealed class FlightTests : IDisposable Assert.IsType(CurrentState(minion)); } + [Fact] + public void APatrollingPilotStaysOnPatrol() + { + var ship = Pilot(null); + var minion = new Minion(ship, FactionDoctrine.Default(_items.GameplaySettings).Combatant) + { Task = new PatrolOrbitsTask { Circuit = new CultRecordKey[1] } }; + + for (var i = 0; i < 30; i++) + { + minion.Update(.1f); + if (i > 0) Assert.IsNotType(CurrentState(minion)); + } + } + private static BaseState CurrentState(Agent agent) => (BaseState) typeof(Agent).GetField("_currentState", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(agent);