diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index d9f96b2673..9deed82e16 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -828,18 +828,6 @@ bool AfterLoadGame() * version. It didn't show up before r12070. */ if (IsSavegameVersionBefore(SLV_87)) UpdateVoidTiles(); - /* If Load Scenario / New (Scenario) Game is used, - * a company does not exist yet. So create one here. - * 1 exception: network-games. Those can have 0 companies - * But this exception is not true for non-dedicated network servers! */ - if (!_networking || (_networking && _network_server && !_network_dedicated)) { - CompanyID first_human_company = GetFirstPlayableCompanyID(); - if (!Company::IsValidID(first_human_company)) { - Company *c = DoStartupNewCompany(false, first_human_company); - c->settings = _settings_client.company; - } - } - /* Fix the cache for cargo payments. */ for (CargoPayment *cp : CargoPayment::Iterate()) { cp->front->cargo_payment = cp; @@ -3232,9 +3220,22 @@ bool AfterLoadGame() AfterLoadLinkGraphs(); - /* Start the scripts. This MUST happen after everything else. */ + /* Start the scripts. This MUST happen after everything else except + * starting a new company. */ StartScripts(); + /* If Load Scenario / New (Scenario) Game is used, + * a company does not exist yet. So create one here. + * 1 exception: network-games. Those can have 0 companies + * But this exception is not true for non-dedicated network servers! */ + if (!_networking || (_networking && _network_server && !_network_dedicated)) { + CompanyID first_human_company = GetFirstPlayableCompanyID(); + if (!Company::IsValidID(first_human_company)) { + Company *c = DoStartupNewCompany(false, first_human_company); + c->settings = _settings_client.company; + } + } + return true; }