Query daemon zones by explicit zone index
This commit is contained in:
parent
7440eda8a9
commit
d7fc9d29eb
3 changed files with 14 additions and 13 deletions
|
|
@ -851,11 +851,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
return RuntimeCatalog?.FindItem(item?.ItemKey ?? "");
|
||||
}
|
||||
|
||||
private static int ZoneIndex(GalaxyZone zone)
|
||||
{
|
||||
return zone?.ZoneIndex ?? -1;
|
||||
}
|
||||
|
||||
private static GalaxyZone FindObservedGalaxyZone(int daemonZoneIndex)
|
||||
{
|
||||
return daemonZoneIndex < 0
|
||||
|
|
@ -863,15 +858,14 @@ public class ActionGameManager : MonoBehaviour
|
|||
: ObservedGalaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(GalaxyZone zone)
|
||||
public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(int daemonZoneIndex)
|
||||
{
|
||||
var zoneIndex = ZoneIndex(zone);
|
||||
if (zoneIndex < 0)
|
||||
if (daemonZoneIndex < 0)
|
||||
return null;
|
||||
|
||||
var run = ResolveDaemonObserver()?.LastObservedState?.Run;
|
||||
return (run?.Zones ?? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>())
|
||||
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == zoneIndex);
|
||||
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
|
||||
public GalaxyZone CurrentDaemonGalaxyZone
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
.Where(name => !string.IsNullOrWhiteSpace(name))
|
||||
.ToArray();
|
||||
|
||||
var daemonZone = GameManager?.FindDaemonZoneSnapshot(zone);
|
||||
var daemonZone = GameManager?.FindDaemonZoneSnapshot(zone?.ZoneIndex ?? -1);
|
||||
if (daemonZone == null)
|
||||
{
|
||||
return new AetheriaRuntimeZoneDetailsSurfaceState(
|
||||
|
|
|
|||
Loading…
Reference in a new issue