diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs index 293a681bd..7737444f8 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs @@ -145,7 +145,11 @@ namespace GameCult.Aetheria.State.Verse public Task LatestAsync() { - return LatestAsync(_currentEntity, _currentDocking, _stationRefit); + return CultMesh.LatestAsync( + _currentEntity, + _currentDocking, + _stationRefit, + CreateSnapshot); } public AetheriaClientDockingSnapshot Latest() @@ -153,14 +157,11 @@ namespace GameCult.Aetheria.State.Verse return LatestAsync().ConfigureAwait(false).GetAwaiter().GetResult(); } - private static async Task LatestAsync( - CultMeshDocumentHandle currentEntity, - CultMeshDocumentHandle currentDocking, - CultMeshDocumentHandle stationRefit) + private static AetheriaClientDockingSnapshot CreateSnapshot( + AetheriaRuntimeCurrentEntityDocument? entity, + AetheriaRuntimeCurrentDockingDocument? docking, + AetheriaRuntimeStationRefitDocument? refit) { - var entity = await currentEntity.LatestAsync().ConfigureAwait(false); - var docking = await currentDocking.LatestAsync().ConfigureAwait(false); - var refit = await stationRefit.LatestAsync().ConfigureAwait(false); var dockingBay = refit?.IsDocked == true && refit.DockingBayIndex >= 0 ? (refit.DockingBays ?? Array.Empty()) .FirstOrDefault(row => row != null && row.DockingBayIndex == refit.DockingBayIndex)