Fix #6544: Don't join AI company when loading network game in singleplayer

This commit is contained in:
Tyler Trahan
2022-01-19 16:46:51 -07:00
committed by rubidium42
parent 5ea55f3948
commit ec90fb4c99
4 changed files with 41 additions and 10 deletions

View File

@@ -835,9 +835,9 @@ void HandleExitGameRequest()
*/
static void OnStartGame(bool dedicated_server)
{
/* Update the local company for a loaded game. It is either always
* company #1 (eg 0) or in the case of a dedicated server a spectator */
SetLocalCompany(dedicated_server ? COMPANY_SPECTATOR : COMPANY_FIRST);
/* Update the local company for a loaded game. It is either the first available company
* or in the case of a dedicated server, a spectator */
SetLocalCompany(dedicated_server ? COMPANY_SPECTATOR : GetFirstPlayableCompanyID());
/* Update the static game info to set the values from the new game. */
NetworkServerUpdateGameInfo();