From 937be5117a81f1ba81edb97f7feb513ea2df295c Mon Sep 17 00:00:00 2001 From: beleata Date: Wed, 19 Aug 2026 22:39:07 +0300 Subject: [PATCH 1/2] Fix two faults that stop a saved world from ever loading Both only show up when joining a server whose world came from a save, so neither could be hit while world saving was broken. - Ship.FixedUpdate is async and awaits a network send, and the continuation can resume off the main thread. Reading Time.fixedDeltaTime after it throws, the exception is never observed, and loading stops where it stands. The value is now taken before the await. - A restored character carries quest progress, so World.OnLogin puts quest markers on the map, and QuestIndicators.IndicatorPrefab is not assigned in the scene. Instantiating it throws out of the login handler, which never finishes, and the client sits on the loading screen for ever with nothing in the log to say why. A missing marker prefab now skips the marker instead. The reference itself is still worth assigning. Co-Authored-By: Claude Opus 5 --- Assets/Scripts/QuestIndicators.cs | 8 ++++++++ Assets/Scripts/ZeroGravity/Objects/Ship.cs | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/QuestIndicators.cs b/Assets/Scripts/QuestIndicators.cs index 47287a3f..555bdbcd 100644 --- a/Assets/Scripts/QuestIndicators.cs +++ b/Assets/Scripts/QuestIndicators.cs @@ -41,6 +41,14 @@ private void Awake() public void AddQuestIndicator(SceneQuestTrigger sceneQuestTrigger) { + // A missing marker prefab must not abort World.OnLogin: the exception propagates out + // of the login handler and leaves the client stuck on the loading screen forever. + if (IndicatorPrefab == null) + { + Debug.LogError("QuestIndicators.IndicatorPrefab is not assigned; skipping quest indicator."); + return; + } + if (!SceneQuestTriggers.ContainsKey(sceneQuestTrigger) && sceneQuestTrigger.Visibility != 0 && sceneQuestTrigger.gameObject.activeInHierarchy) { diff --git a/Assets/Scripts/ZeroGravity/Objects/Ship.cs b/Assets/Scripts/ZeroGravity/Objects/Ship.cs index 8aa07dc2..b95dea81 100644 --- a/Assets/Scripts/ZeroGravity/Objects/Ship.cs +++ b/Assets/Scripts/ZeroGravity/Objects/Ship.cs @@ -152,6 +152,9 @@ private void Update() private async UniTaskVoid FixedUpdate() { + // Captured up front: the await below can resume on a worker thread, and Unity only + // allows Time.fixedDeltaTime to be read on the main thread. + float fixedDeltaTime = Time.fixedDeltaTime; if (AutoStabilize.IsNotEpsilonZero() && AngularVelocity != Vector3.zero) { Vector3? autoStabilize = AutoStabilize; @@ -231,7 +234,7 @@ private async UniTaskVoid FixedUpdate() _shipStatsChanged = false; } - SmoothRotation(Time.fixedDeltaTime); + SmoothRotation(fixedDeltaTime); } public void SetRotationPredictionValues(Vector3D forward, Vector3D up) From ccfa0bc888c4f82e315ab6818ced0eed48257e8f Mon Sep 17 00:00:00 2001 From: Makkkkus Date: Mon, 24 Aug 2026 00:11:33 +0200 Subject: [PATCH 2/2] Replace error log with warning for missing prefabs --- Assets/Scripts/QuestIndicators.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/QuestIndicators.cs b/Assets/Scripts/QuestIndicators.cs index f7124fa0..5575f381 100644 --- a/Assets/Scripts/QuestIndicators.cs +++ b/Assets/Scripts/QuestIndicators.cs @@ -42,14 +42,12 @@ private void Awake() public void AddQuestIndicator(SceneQuestTrigger sceneQuestTrigger) { - // A missing marker prefab must not abort World.OnLogin: the exception propagates out - // of the login handler and leaves the client stuck on the loading screen forever. if (IndicatorPrefab == null) { - Debug.LogError("QuestIndicators.IndicatorPrefab is not assigned; skipping quest indicator."); + Debug.LogWarning("QuestIndicators.IndicatorPrefab is not assigned; skipping quest indicator."); return; } - + if (!SceneQuestTriggers.ContainsKey(sceneQuestTrigger) && sceneQuestTrigger.Visibility != 0 && sceneQuestTrigger.gameObject.activeInHierarchy) { @@ -68,6 +66,12 @@ public void AddQuestIndicator(SceneQuestTrigger sceneQuestTrigger) public void AddAvailableQuestIndicator(SceneQuestTrigger sceneQuestTrigger) { + if (NewQuestIndicatorPrefab == null) + { + Debug.LogWarning("QuestIndicators.NewQuestIndicatorPrefab is not assigned; skipping it."); + return; + } + if (!SceneQuestTriggers.ContainsKey(sceneQuestTrigger) && sceneQuestTrigger.Visibility != 0 && sceneQuestTrigger.gameObject.activeInHierarchy) {