+ // Dragging can be used as either a cheat, or a tool for g_sandbox. If sv_cheats is active,
+ // the cheat dragging is used (unlimited pickup range and any entity can be carried), even if
+ // g_sandbox is enabled. Is sv_cheats is disabled but g_sandbox is not, then sandbox dragging
+ // is used (limited pickup range and only sandbox objects can be carried), grabbing itself
+ // no longer being accounted as cheating. If both sv_cheats and g_sandbox are disabled, players
+ // attempting to grab objects are reported as trying to cheat.
+
+ switch(0)
+ {
+ default:
+ if(self.BUTTON_DRAG && !cvar("g_sandbox"))
+ {
+ // consider dragging a cheat only if sandbox mode is disabled
+ IS_CHEAT(0, 0, CHRAME_DRAG);
+ }
+ if(autocvar_sv_cheats)
+ {
+ // only use cheat dragging if cheats are enabled
+ crosshair_trace_plusvisibletriggers(self);
+ if(Drag(trace_ent, TRUE) && !cvar("g_sandbox"))
+ DID_CHEAT();
+ }
+ break;
+ }
+
+ END_CHEAT_FUNCTION();
+}
+
+
+
+
+
+// ENTITY DRAGGING
+
+float Drag(entity e, float grab)
+{
+ // returns TRUE when an entity has been picked up
+ // If grab is TRUE, the object can also be picked up if it's not being held already
+ // If grab is FALSE, only keep dragging the object if it's already being held
+