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 committed Feb 16, 2023
1 parent 27cbb81 commit f2a20c5
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 @@ -544,14 +544,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();

ShowScriptDebugWindowIfScriptError();
}

Expand Down

0 comments on commit f2a20c5

Please sign in to comment.