1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-24 23:19: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()
{
/* 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();
}