dead people shouldn't cheat
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Mon, 25 Jan 2010 17:12:49 +0000 (17:12 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Mon, 25 Jan 2010 17:12:49 +0000 (17:12 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8570 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/cheats.qc

index 0f94c1f..00022ef 100644 (file)
@@ -46,13 +46,25 @@ void CheatShutdownClient()
 
 float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as argument for possible future ACL checking
 {
+       // dead people cannot cheat
+       if(self.deadflag != DEAD_NO)
+               return 0;
+       if(self.classname != "player")
+               return 0;
+       
+       // sv_clones
        if(i == CHIMPULSE_CLONE_MOVING || i == CHIMPULSE_CLONE_STANDING)
                if(self.lip < sv_clones)
                        return 1;
+
+       // haha
        if(self.maycheat)
                return 1;
+       
+       // sv_cheats
        if(sv_cheats && autocvar_sv_cheats)
                return 1;
+
        return 0;
 }