Fix #301: Network server local company change on load did not update network state

This commit is contained in:
Jonathan G Rennison 2021-07-17 21:30:05 +01:00
parent 2fc35aed2f
commit 8c9dd75b5b

View File

@ -1251,7 +1251,11 @@ void SwitchToMode(SwitchMode new_mode)
} }
/* Update the local company for a loaded game. It is either always /* Update the local company for a loaded game. It is either always
* a company or in the case of a dedicated server a spectator */ * a company or in the case of a dedicated server a spectator */
SetLocalCompany(_network_dedicated ? COMPANY_SPECTATOR : GetDefaultLocalCompany()); if (_network_server && !_network_dedicated) {
NetworkServerDoMove(CLIENT_ID_SERVER, GetDefaultLocalCompany());
} else {
SetLocalCompany(_network_dedicated ? COMPANY_SPECTATOR : GetDefaultLocalCompany());
}
if (_ctrl_pressed && !_network_dedicated) { if (_ctrl_pressed && !_network_dedicated) {
DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
} }