summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-17 22:16:46 +0000
committerDarkvater <darkvater@openttd.org>2006-10-17 22:16:46 +0000
commitfbc724c6cb0847c765ebc95d0598f608474c7476 (patch)
tree3c5e7e6bcdb563a73452b3392ed9da9e30aa513c /openttd.c
parent821df34b6ea306b19c64555f478910cacc44c48e (diff)
downloadopenttd-fbc724c6cb0847c765ebc95d0598f608474c7476.tar.xz
(svn r6814) -Codechange: For network games ci->client_playas was always p->index + 1. To
correctly handle this ci->client_playas - 1 was used all over the code making it pretty confusing at times. Use proper one-on-one values now. Special handling is only needed for user-output to not to confuse users.
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openttd.c b/openttd.c
index dc046c9ab..078f55699 100644
--- a/openttd.c
+++ b/openttd.c
@@ -477,12 +477,17 @@ int ttd_main(int argc, char *argv[])
uint16 rport;
rport = NETWORK_DEFAULT_PORT;
+ _network_playas = PLAYER_NEW_COMPANY;
ParseConnectionString(&player, &port, network_conn);
if (player != NULL) {
_network_playas = atoi(player);
- if (_network_playas == 0) _network_playas = PLAYER_NEW_COMPANY;
+
+ if (_network_playas != PLAYER_SPECTATOR) {
+ _network_playas--;
+ if (!IsValidPlayer(_network_playas)) return false;
+ }
}
if (port != NULL) rport = atoi(port);