Skip to content

Commit

Permalink
Fix #10486: [Script] Debug window requires AIs to be started before GS (
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 authored and rubidium42 committed Mar 31, 2023
1 parent 617d794 commit 0604f57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/saveload/afterload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,16 @@ static inline bool MayHaveBridgeAbove(TileIndex t)
*/
static void StartScripts()
{
/* Start the GameScript. */
Game::StartNew();
/* Script debug window requires AIs to be started before trying to start GameScript. */

/* Start the AIs. */
for (const Company *c : Company::Iterate()) {
if (Company::IsValidAiID(c->index)) AI::StartNew(c->index, false);
}

/* Start the GameScript. */
Game::StartNew();

ShowAIDebugWindowIfAIError();
}

Expand Down

0 comments on commit 0604f57

Please sign in to comment.