]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_ca.qc
Kill another gamemode specific check
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_ca.qc
index eb883118749f4df962eccb03b3ebc73e4e51bb8b..8881ab2eed11be043460a2bc7e759453f8328947 100644 (file)
@@ -443,6 +443,19 @@ MUTATOR_HOOKFUNCTION(ca, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
        return true;
 }
 
+MUTATOR_HOOKFUNCTION(ca, ClientCommand_Spectate)
+{
+       if(self.caplayer)
+       {
+               // they're going to spec, we can do other checks
+               if(autocvar_sv_spectate && (IS_SPEC(self) || IS_OBSERVER(self)))
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_CA_LEAVE);
+               return MUT_SPECCMD_FORCE;
+       }
+
+       return MUT_SPECCMD_CONTINUE;
+}
+
 void ca_Initialize()
 {
        allowed_to_spawn = true;