]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 ec2b661c313cdb7d779ff6eeb1d13fdc908ca72a..500a36ebe45d1fab19bfc19bd8ad925116d3fcf8 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 8c276919c51082206169b6050dd44335d7d1fc84..c9a449b53794a6681e2f9b5d1dd5db9be56bae3b 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