X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcmd.qc;h=14ffd3468aca61adf180bb6277df95c43510c2dc;hp=1321f26b3a2a6dd42c92586e46ed935ea7cb05da;hb=bf5c2d4a98483e1f56f585ec7f22f1bff3c2e954;hpb=f974062fbc8c2a2f086f036c2e8664517434b7e1 diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 1321f26b3a..14ffd3468a 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -152,6 +152,8 @@ void ClientCommand_join(float request) { if(!IS_PLAYER(self) && !lockteams) { + if(self.caplayer) + return; if(nJoinAllowed(self)) { if(autocvar_g_campaign) { campaign_bots_may_start = 1; } @@ -289,7 +291,7 @@ void ClientCommand_mobspawn(float request, float argc) else if(MUTATOR_CALLHOOK(AllowMobSpawning)) { sprint(self, "Monster spawning is currently disabled by a mutator.\n"); return; } else if(!autocvar_g_monsters) { Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_MONSTERS_DISABLED); return; } else if(self.vehicle) { sprint(self, "You can't spawn monsters while driving a vehicle.\n"); return; } - else if(self.freezetag_frozen) { sprint(self, "You can't spawn monsters while frozen.\n"); return; } + else if(self.frozen) { sprint(self, "You can't spawn monsters while frozen.\n"); return; } else if(autocvar_g_campaign) { sprint(self, "You can't spawn monsters in campaign mode.\n"); return; } else if(self.deadflag != DEAD_NO) { sprint(self, "You can't spawn monsters while dead.\n"); return; } else if(monstercount >= autocvar_g_monsters_max_perplayer) { sprint(self, "You have spawned too many monsters, kill some before trying to spawn any more.\n"); return; } @@ -620,15 +622,11 @@ void ClientCommand_spectate(float request) } } - if(IS_PLAYER(self) && autocvar_sv_spectate == 1) - ClientKill_TeamChange(-2); // observe - - // in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list) - // note: if arena game mode is ever done properly, this needs to be removed. - if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self))) + if((IS_PLAYER(self) || self.caplayer) && autocvar_sv_spectate == 1) { - sprint(self, "WARNING: you will spectate in the next round.\n"); - self.caplayer = 0; + if(self.caplayer && (IS_SPEC(self) || IS_OBSERVER(self))) + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_CA_LEAVE); + ClientKill_TeamChange(-2); // observe } } return; // never fall through to usage