Don't consider grabbing a cheat if sandbox mode is enabled
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 22:27:00 +0000 (01:27 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 22:27:00 +0000 (01:27 +0300)
qcsrc/server/cheats.qc
qcsrc/server/cheats.qh

index ec2b661..500a36e 100644 (file)
@@ -685,11 +685,18 @@ float CheatFrame()
        switch(0)
        {
                default:
-                       if(self.BUTTON_DRAG)
+                       if(self.BUTTON_DRAG && !cvar("g_sandbox"))
+                       {
+                               // consider dragging a cheat only if sandbox mode is disabled
                                IS_CHEAT(0, 0, CHRAME_DRAG);
-                       crosshair_trace_plusvisibletriggers(self);
-                       if(Drag(trace_ent))
-                               DID_CHEAT();
+                       }
+                       if(autocvar_sv_cheats)
+                       {
+                               // only use non-sandbox dragging if cheats are enabled
+                               crosshair_trace_plusvisibletriggers(self);
+                               if(Drag(trace_ent) && !cvar("g_sandbox"))
+                                       DID_CHEAT();
+                       }
                        break;
        }
 
index 8c27691..c9a449b 100644 (file)
@@ -11,3 +11,5 @@ float CheatCommand(float argc);
 float CheatFrame();
 
 void Drag_MoveDrag(entity from, entity to); // call this from CopyBody
+
+float Drag(entity e); // used by sandbox code
\ No newline at end of file