Skip to content

Commit

Permalink
Fix OpenTTD#10486: [Script] Debug window requires AIs to be started b…
Browse files Browse the repository at this point in the history
…efore GS (OpenTTD#10487)
  • Loading branch information
glx22 authored and rubidium42 committed Mar 26, 2023
1 parent 9f8797e commit 2ba4370
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 2ba4370

Please sign in to comment.