From 5098c77c380bf2fd1da87aa906c4a334e589ca5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Tue, 20 Feb 2024 17:08:26 +0100 Subject: [PATCH] Fix: [Script] Only show debug script window at the end of savegame loading (#12135) (cherry picked from commit 2d7ad9f7173ae14bbc82ccb39574ccedb3891e6a) --- src/ai/ai_instance.cpp | 3 +++ src/game/game_instance.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 37bdc40181..c9c33d4b14 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -63,6 +63,9 @@ void AIInstance::Died() /* Intro is not supposed to use AI, but it may have 'dummy' AI which instant dies. */ if (_game_mode == GM_MENU) return; + /* Don't show errors while loading savegame. They will be shown at end of loading anyway. */ + if (_switch_mode != SM_NONE) return; + ShowScriptDebugWindow(_current_company); const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo(); diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index e95a77ddac..ecc698334f 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -66,6 +66,9 @@ void GameInstance::Died() { ScriptInstance::Died(); + /* Don't show errors while loading savegame. They will be shown at end of loading anyway. */ + if (_switch_mode != SM_NONE) return; + ShowScriptDebugWindow(OWNER_DEITY); const GameInfo *info = Game::GetInfo();