]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_lms.qc
Kill another gamemode specific check
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_lms.qc
index e9297d88b57b554e1cca0702b6103dd160327410..c065e7a9682eb7123f7fe8a13e5a23538efbb56f 100644 (file)
@@ -212,6 +212,24 @@ MUTATOR_HOOKFUNCTION(lms, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
        return true;
 }
 
+MUTATOR_HOOKFUNCTION(lms, ClientCommand_Spectate)
+{
+       if(self.lms_spectate_warning)
+       {
+               // for the forfeit message...
+               self.lms_spectate_warning = 2;
+               // mark player as spectator
+               PlayerScore_Add(self, SP_LMS_RANK, 666 - PlayerScore_Add(self, SP_LMS_RANK, 0));
+       }
+       else
+       {
+               self.lms_spectate_warning = 1;
+               sprint(self, "WARNING: you won't be able to enter the game again after spectating in LMS. Use the same command again to spectate anyway.\n");
+               return MUT_SPECCMD_RETURN;
+       }
+       return MUT_SPECCMD_CONTINUE;
+}
+
 // scoreboard stuff
 void lms_ScoreRules()
 {