(svn r6787) -Codechange: Use PLAYER_NEW_COMPANY as a player identifier wishing to become a

new player instead of a 0.
This commit is contained in:
Darkvater
2006-10-15 23:48:34 +00:00
parent 7cac86186e
commit d5baf25923
6 changed files with 31 additions and 8 deletions

View File

@@ -596,7 +596,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
// join another company does not affect these values
switch (playas) {
case 0: /* New company */
case PLAYER_NEW_COMPANY: /* New company */
if (ActivePlayerCount() >= _network_game_info.companies_max) {
SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_FULL);
return;
@@ -608,6 +608,12 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
return;
}
break;
default: /* Join another company (companies 1-8) */
if (!IsValidPlayer(playas - 1)) {
SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_PLAYER_MISMATCH);
return;
}
break;
}
// We need a valid name.. make it Player