Flight: a member that cannot see the engaged track steers on its bearing

The member kept Target to its own sensors but fell back to patrol while a
flightmate fought; it now follows the engaged track as it followed the
hailed one (ruling shared-track-bearing-only: a bearing, never targeting data).

Builds: not yet verified at this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-08 18:13:48 +02:00
commit f91f658ad2
2 changed files with 19 additions and 1 deletions

View file

@ -150,8 +150,10 @@ public class Flight
return;
}
// No engaged track in this member's own sensors: it steers on the flight's picture, a bearing and never targeting
// data (ruling shared-track-bearing-only). That is the hailed and the complied, and an engaged track only a flightmate sees.
Aim(ship, null);
var held = picture.Where(e => _tracks[e].Phase == Phase.Hailing || _tracks[e].Phase == Phase.Complied).ToList();
var held = picture.Where(e => _tracks[e].Phase != Phase.None).ToList();
if (held.Count > 0)
{
var anchor = member.Agent.Task is FollowTask follow && held.Contains(follow.Anchor)

View file

@ -533,6 +533,22 @@ public sealed class FlightTests : IDisposable
Assert.IsNotType<FollowState>(CurrentState(minion));
}
[Fact]
public void AMemberThatCannotSeeTheEngagedTrackClosesOnItsBearing()
{
var faction = WithDoctrine(EngageOn.Detection);
var sighted = Pilot(faction);
var blind = Pilot(faction, 10);
var track = Track();
See(sighted, track);
Tick(.1f);
Assert.Same(track, sighted.Target.Value.Entity);
Assert.True(blind.Target.Value.IsNone);
var task = Assert.IsType<FollowTask>(_zone.Agents.Single(a => a.Ship == blind).Task);
Assert.Same(track, task.Anchor);
}
private static string TempCatalog() => Path.Combine(Path.GetTempPath(), "aetheria-doctrine-" + Guid.NewGuid().ToString("N") + ".cc");
[Fact]