From 5ca76f266a8a439f2162011cfebc92c80f1e33ad Mon Sep 17 00:00:00 2001 From: soul Date: Sun, 29 Nov 2026 19:28:14 +0100 Subject: [PATCH] Waypoint reads the ship's own zone first A leg whose orbit lies in the hauler's zone needs no search of the region (and a galaxy whose entrance Contents a test never set made the search find no zone, leaving the on-screen hauler idle: TheLegIsTheHold and AHaulerCarriesSiloOreToTheRefinery). Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/ServerShared/HaulRun.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/ServerShared/HaulRun.cs b/Assets/Scripts/ServerShared/HaulRun.cs index e624df256..0c6385734 100644 --- a/Assets/Scripts/ServerShared/HaulRun.cs +++ b/Assets/Scripts/ServerShared/HaulRun.cs @@ -71,10 +71,11 @@ public static class HaulRun { var orbit = Leg(ship, order); var zone = ship.Zone; - if (zone.Galaxy == null || zone.GalaxyZone == null) return zone.Orbits.ContainsKey(orbit) ? (orbit, null) : ((CultRecordKey, GalaxyZone)?) null; + // The ship's own zone first: the leg's orbit there is the common case and needs no search of the region. + if (zone.Orbits.ContainsKey(orbit)) return (orbit, null); + if (zone.Galaxy == null || zone.GalaxyZone == null) return null; var target = ZoneOf(zone.Galaxy, orbit); - if (target == null) return null; - if (target == zone.GalaxyZone) return (orbit, null); + if (target == null || target == zone.GalaxyZone) return null; var path = zone.Galaxy.FindPath(zone.GalaxyZone, target); return path != null && path.Length > 1 ? (orbit, path[1]) : ((CultRecordKey, GalaxyZone)?) null; }