summaryrefslogtreecommitdiff
path: root/network_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'network_server.c')
-rw-r--r--network_server.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/network_server.c b/network_server.c
index 51c11ba83..42fc6efe0 100644
--- a/network_server.c
+++ b/network_server.c
@@ -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