1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

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 rubidium42
parent 617d794af6
commit 0604f571e1

View File

@@ -542,14 +542,16 @@ static inline bool MayHaveBridgeAbove(TileIndex t)
*/ */
static void StartScripts() static void StartScripts()
{ {
/* Start the GameScript. */ /* Script debug window requires AIs to be started before trying to start GameScript. */
Game::StartNew();
/* Start the AIs. */ /* Start the AIs. */
for (const Company *c : Company::Iterate()) { for (const Company *c : Company::Iterate()) {
if (Company::IsValidAiID(c->index)) AI::StartNew(c->index, false); if (Company::IsValidAiID(c->index)) AI::StartNew(c->index, false);
} }
/* Start the GameScript. */
Game::StartNew();
ShowAIDebugWindowIfAIError(); ShowAIDebugWindowIfAIError();
} }