Resolve towing target zone from daemon snapshot
This commit is contained in:
parent
26f0392a23
commit
348f83a7f5
2 changed files with 13 additions and 2 deletions
|
|
@ -3051,7 +3051,9 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
private AetheriaRuntimeZoneSnapshotCommit FindCurrentDaemonZoneSnapshot()
|
||||
{
|
||||
return FindDaemonZoneSnapshot(CurrentDaemonGalaxyZone);
|
||||
var run = ResolveDaemonObserver()?.LastObservedState?.Run;
|
||||
return (run?.Zones ?? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>())
|
||||
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == run.CurrentZoneIndex);
|
||||
}
|
||||
|
||||
private bool TryGetDaemonEntitySnapshot(Entity entity, out AetheriaRuntimeEntitySnapshotCommit snapshot)
|
||||
|
|
@ -3065,6 +3067,13 @@ public class ActionGameManager : MonoBehaviour
|
|||
return snapshot != null;
|
||||
}
|
||||
|
||||
private int ResolveObservedEntityZoneIndex(Entity entity)
|
||||
{
|
||||
return TryGetDaemonEntitySnapshot(entity, out _)
|
||||
? FindCurrentDaemonZoneSnapshot()?.ZoneIndex ?? -1
|
||||
: -1;
|
||||
}
|
||||
|
||||
private bool TryGetDaemonParentSnapshot(
|
||||
Entity child,
|
||||
out AetheriaRuntimeEntitySnapshotCommit parentSnapshot,
|
||||
|
|
@ -3270,7 +3279,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
|
||||
var stationEntityKey = ResolveEntityRecordKey(TowingStation);
|
||||
var targetZoneIndex = ZoneIndex(TowingStation.Zone?.GalaxyZone);
|
||||
var targetZoneIndex = ResolveObservedEntityZoneIndex(TowingStation);
|
||||
if (string.IsNullOrWhiteSpace(stationEntityKey) || targetZoneIndex < 0)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue