- if (IS_CLIENT(caller))
- {
- if (!IS_PLAYER(caller) && !lockteams && !gameover)
- {
- if (caller.caplayer) return;
- if (nJoinAllowed(caller, caller))
- {
- if (autocvar_g_campaign) campaign_bots_may_start = true;
- TRANSMUTE(Player, caller);
- PlayerScore_Clear(caller);
- Kill_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CPID_PREVENT_JOIN);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && caller.team != -1) ? APP_TEAM_ENT(caller, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), caller.netname);
- PutClientInServer(caller);
- }
- else
- {
- // player may not join because of g_maxplayers is set
- Send_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CENTER_JOIN_PREVENT);
- }
- }
- }
+ if (!gameover)
+ if (IS_CLIENT(caller) && !IS_PLAYER(caller))
+ if (spawnAllowed(caller))
+ LeaveSpectatorMode(caller);
+