summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-01-28 01:33:57 +0000
committerDarkvater <darkvater@openttd.org>2006-01-28 01:33:57 +0000
commitb3a2f09ae949b37105ee4a8f435eb2153749688a (patch)
tree87c02d1fa9164dd5aae98ab544cfeb6c9edaa0ef
parentd6933998e465be258c304cb30cbbc3d3d54f5ae9 (diff)
downloadopenttd-b3a2f09ae949b37105ee4a8f435eb2153749688a.tar.xz
(svn r3454) - Fix: company-count was not updated correctly when loading a saved game with already existing companies for multiplayer.
-rw-r--r--openttd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openttd.c b/openttd.c
index 28c97c3b5..5e8731f08 100644
--- a/openttd.c
+++ b/openttd.c
@@ -762,8 +762,13 @@ void SwitchMode(int new_mode)
_local_player = 0;
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
#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);
+ }
#endif /* ENABLE_NETWORK */
}
break;