(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.
This commit is contained in:
Darkvater
2006-10-17 22:16:46 +00:00
parent 821df34b6e
commit fbc724c6cb
10 changed files with 79 additions and 83 deletions

View File

@@ -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);