]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/sandbox.qc
Move non-cheat grabbing back into cheatfrae, so all code is in one place. Also remove...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / sandbox.qc
index 73436eb3f81cee08e24e0a8183baead268faafd6..2c4b27034e667298af111d6721410612d6d03392 100644 (file)
@@ -716,31 +716,6 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
        return FALSE;
 }
 
-MUTATOR_HOOKFUNCTION(sandbox_PlayerPreThink)
-{
-       // if the player is close enough to their object, they can drag it
-
-       if(autocvar_sv_cheats)
-               return FALSE; // cheat dragging is used instead
-
-       // grab is TRUE if the object can be picked up. While an object is being carried, the Drag() function
-       // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace.
-       // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
-       // it goes out of range while slinging it around.
-
-       entity e;
-       float grab;
-
-       e = sandbox_ObjectEdit_Get(TRUE);
-       if(e != world && vlen(e.origin - self.origin) <= autocvar_g_sandbox_editor_distance_edit)
-               grab = TRUE;
-
-       if(Drag(e, grab)) // execute dragging
-               return TRUE;
-
-       return FALSE;
-}
-
 float autosave_time;
 MUTATOR_HOOKFUNCTION(sandbox_StartFrame)
 {
@@ -759,7 +734,6 @@ MUTATOR_DEFINITION(sandbox)
 {
        MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY);
        MUTATOR_HOOK(SV_StartFrame, sandbox_StartFrame, CBC_ORDER_ANY);
-       MUTATOR_HOOK(PlayerPreThink, sandbox_PlayerPreThink, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {