From 6d8416e651241f29c13f64b2e5a6e504534bf844 Mon Sep 17 00:00:00 2001 From: Helco Date: Sat, 27 Jan 2024 21:26:43 +0100 Subject: [PATCH] zzre: Fix ScrNotification upon starting in ZanzarahWindow --- zzre/game/Game.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zzre/game/Game.cs b/zzre/game/Game.cs index 0cd448c2..e8cbc583 100644 --- a/zzre/game/Game.cs +++ b/zzre/game/Game.cs @@ -18,6 +18,7 @@ public class Game : BaseDisposable, ITagContainer private readonly GameTime time; private readonly DefaultEcs.World ecsWorld; private readonly Camera camera; + private readonly OnceAction onceUpdate = new(); private readonly ISystem updateSystems; private readonly ISystem renderSystems; private readonly systems.SyncedLocation syncedLocation; @@ -156,7 +157,7 @@ public Game(ITagContainer diContainer, Savegame savegame) //camera.Location.LocalPosition = -worldBuffers.Origin; ecsWorld.Set(worldLocation); - LoadOverworldScene(savegame.sceneId, () => FindEntryTrigger(savegame.entryId)); + onceUpdate.Next += () => LoadOverworldScene(savegame.sceneId, () => FindEntryTrigger(savegame.entryId)); } protected override void DisposeManaged() @@ -178,6 +179,7 @@ private void HandleResize() public void Update() { + onceUpdate.Invoke(); updateSystems.Update(time.Delta); }