mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r3454) - Fix: company-count was not updated correctly when loading a saved game with already existing companies for multiplayer.
This commit is contained in:
parent
d6933998e4
commit
b3a2f09ae9
@ -762,8 +762,13 @@ void SwitchMode(int new_mode)
|
|||||||
_local_player = 0;
|
_local_player = 0;
|
||||||
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
|
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
if (_network_server)
|
if (_network_server) {
|
||||||
|
/* If we have loaded a game we need to correctly update the company-count */
|
||||||
|
const Player *p;
|
||||||
|
_network_game_info.companies_on = 0;
|
||||||
|
FOR_ALL_PLAYERS(p) {if (p->is_active) _network_game_info.companies_on++;}
|
||||||
snprintf(_network_game_info.map_name, NETWORK_NAME_LENGTH, "%s (Loaded game)", _file_to_saveload.title);
|
snprintf(_network_game_info.map_name, NETWORK_NAME_LENGTH, "%s (Loaded game)", _file_to_saveload.title);
|
||||||
|
}
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user