summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-01-31 22:16:15 +0000
committerDarkvater <darkvater@openttd.org>2006-01-31 22:16:15 +0000
commitf2448ebfd4324b0c914e36b81801fc1ffa04da94 (patch)
tree763ef198108c0320af48fbac22bf9c998430da2d /openttd.c
parent9d07426a29817fbaddcb8f8c726e16a32bb123d0 (diff)
downloadopenttd-f2448ebfd4324b0c914e36b81801fc1ffa04da94.tar.xz
(svn r3500) - Workaround the inaccurate count of spectators/companies that can happen in certain border-cases. For now just dynamically get this value when requested so it is always right. To do properly all player/client creation/destruction needs a hook for networking.
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/openttd.c b/openttd.c
index d25575910..594da648e 100644
--- a/openttd.c
+++ b/openttd.c
@@ -762,13 +762,8 @@ 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 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++;}
+ if (_network_server)
snprintf(_network_game_info.map_name, NETWORK_NAME_LENGTH, "%s (Loaded game)", _file_to_saveload.title);
- }
#endif /* ENABLE_NETWORK */
}
break;