From eb2dc1e501be562b521a015637d71924be42df57 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 15 Oct 2026 00:17:17 +0200 Subject: [PATCH] Scanner progress reads 0 on another target; Program.RoleMapOf exposes roles-backfill's map Scanner.Progress is bound to the target the scan was built on, so a retarget with the scanner switched off no longer draws the old scan on the new target (scan-progress-shown-on-retarget). RoleMapOf is the one accessor HasRoleMap now delegates to. Not yet built or tested. Co-Authored-By: Claude Opus 5.5 --- Assets/Scripts/ServerShared/Behaviors/Scanner.cs | 6 ++++-- tools/AetherDb/Program.cs | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/ServerShared/Behaviors/Scanner.cs b/Assets/Scripts/ServerShared/Behaviors/Scanner.cs index d94a8b978..c1e9ede41 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Scanner.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Scanner.cs @@ -46,8 +46,10 @@ public class Scanner : Behavior, IProgressBehavior // The scan's progress now: what Execute last built, less ScanTime-relative decay over the time since a tick last held // it (ruling scan-held-beam: a broken scan decays over ScanTime, the item inactive or destroyed included). Derived from // the zone clock, never from tick order, so a scanner decays on the tick it breaks whether its host runs Execute - // before the always-updated pass (EquippedItem) or after it (ConsumableItemEffect). The one decay site. - public float Progress => Remaining(_heldAt); + // before the always-updated pass (EquippedItem) or after it (ConsumableItemEffect). The one decay site. It is the + // progress against the ship's target now: a scan built on another ship reads 0 the moment the target changes, whether + // or not the item is running to reset it. + public float Progress => _target == Entity.Target.Value.Entity ? Remaining(_heldAt) : 0f; public Scanner(ScannerData data, EquippedItem item) : base(data, item) { diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index 0d4c96cf1..a99c7526c 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -285,8 +285,12 @@ public static class Program _ => null, }; - // Whether CB-R1 maps this design's stats to roles; the catalog test asks the tool, so it keeps no copy of the kinds. - public static bool HasRoleMap(EquippableItemData item) => RoleMapFor(item, KindOf(item)) != null; + // The field->role map roles-backfill would apply to this design, or null; the catalog tests ask the tool, so they keep no + // copy of the kinds or the maps. + public static IReadOnlyDictionary RoleMapOf(EquippableItemData item) => RoleMapFor(item, KindOf(item)); + + // Whether CB-R1 maps this design's stats to roles. + public static bool HasRoleMap(EquippableItemData item) => RoleMapOf(item) != null; private sealed record RoleAuthoring( EquippableItemData Item, string Kind, List<(string Behavior, string Field, string Role)> StatsAssigned,