do engine cheats in qc too
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Mon, 25 Jan 2010 17:05:08 +0000 (17:05 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Mon, 25 Jan 2010 17:05:08 +0000 (17:05 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8554 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/cheats.qc
data/qcsrc/server/clientcommands.qc

index da9fd17..19bfc5a 100644 (file)
@@ -530,6 +530,55 @@ float CheatCommand(float argc)
                        for(e = world; (e = find(e, classname, "drag_digit")); )
                                remove(e);
                        goto cheated;
+               case "god":
+                       BITXOR_ASSIGN(self.flags, FL_GODMODE);
+                       if(self.flags & FL_GODMODE)
+                       {
+                               sprint(self, "godmode ON\n");
+                               goto cheated;
+                       }
+                       else
+                               sprint(self, "godmode OFF\n");
+                       break;
+               case "notarget":
+                       BITXOR_ASSIGN(self.flags, FL_NOTARGET);
+                       if(self.flags & FL_NOTARGET)
+                       {
+                               sprint(self, "notarget ON\n");
+                               goto cheated;
+                       }
+                       else
+                               sprint(self, "notarget OFF\n");
+                       break;
+               case "noclip":
+                       if(self.movetype != MOVETYPE_NOCLIP)
+                       {
+                               self.movetype = MOVETYPE_NOCLIP;
+                               sprint(self, "noclip ON\n");
+                               goto cheated;
+                       }
+                       else
+                       {
+                               self.movetype = MOVETYPE_WALK;
+                               sprint(self, "noclip OFF\n");
+                       }
+                       break;
+               case "fly":
+                       if(self.movetype != MOVETYPE_FLY)
+                       {
+                               self.movetype = MOVETYPE_FLY;
+                               sprint(self, "flmodey ON\n");
+                               goto cheated;
+                       }
+                       else
+                       {
+                               self.movetype = MOVETYPE_WALK;
+                               sprint(self, "flymode OFF\n");
+                       }
+                       break;
+               case "give":
+                       // TODO
+                       break;
        }
        return 0;
 
index 30ac7b8..93630c4 100644 (file)
@@ -411,16 +411,6 @@ void SV_ParseClientCommand(string s) {
                //      return;
                // grep for Cmd_AddCommand_WithClientCommand to find them all
                if(cmd != "status")
-               if(cmd != "max")
-               if(cmd != "monster")
-               if(cmd != "scrag")
-               if(cmd != "wraith")
-               if(cmd != "gimme")
-               if(cmd != "god")
-               if(cmd != "notarget")
-               if(cmd != "fly")
-               if(cmd != "noclip")
-               if(cmd != "give")
                //if(cmd != "say") // handled above
                //if(cmd != "say_team") // handled above
                if(cmd != "kill")