Fix #10486: [Script] Debug window requires AIs to be started before GS (#10487)

This commit is contained in:
Loïc Guilloux 2023-02-17 12:24:51 +01:00 committed by GitHub
parent 27cbb81df5
commit 4072dcff49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}