forked from mirror/OpenTTD
(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:
@@ -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
|
||||
|
Reference in New Issue
Block a user