On load, use previous local company or first usable company

Instead of always using the first company slot
This commit is contained in:
Jonathan G Rennison
2020-09-20 17:36:36 +01:00
parent 9af2c258fa
commit 4763f441f6
8 changed files with 46 additions and 6 deletions

View File

@@ -970,9 +970,8 @@ bool AfterLoadGame()
* 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 (!Company::IsValidID(COMPANY_FIRST) && (!_networking || (_networking && _network_server && !_network_dedicated))) {
DoStartupNewCompany(false);
Company *c = Company::Get(COMPANY_FIRST);
if (!Company::IsValidID(GetDefaultLocalCompany()) && (!_networking || (_networking && _network_server && !_network_dedicated))) {
Company *c = DoStartupNewCompany(false);
c->settings = _settings_client.company;
}