Skip to content

Commit

Permalink
Fix: [Script] Only show debug script window at the end of savegame lo…
Browse files Browse the repository at this point in the history
…ading (OpenTTD#12135)
  • Loading branch information
glx22 authored Feb 20, 2024
1 parent f1bf39f commit 2d7ad9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ai/ai_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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();
Expand Down
3 changes: 3 additions & 0 deletions src/game/game_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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();
Expand Down

0 comments on commit 2d7ad9f

Please sign in to comment.