]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qc
Make the slick flag usable outside of applygravity
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qc
index 5ba6e82685b3204ce2caa5da04c5862253f0c974..02657dee8db2f80360d38e04cd83d917cc3d06dc 100644 (file)
@@ -145,6 +145,9 @@ void PM_ClientMovement_UpdateStatus(entity this)
                do_crouch = false;
     }
 
+    MUTATOR_CALLHOOK(PlayerCanCrouch, this, do_crouch);
+    do_crouch = M_ARGV(1, bool);
+
        if (do_crouch) {
                if (!IS_DUCKED(this)) {
                        SET_DUCKED(this);
@@ -687,13 +690,12 @@ void PM_check_slick(entity this)
        if(!IS_ONGROUND(this))
                return;
 
-       if(!PHYS_SLICK_APPLYGRAVITY(this))
-               return;
-
+       trace_dphitq3surfaceflags = 0;
        tracebox(this.origin, this.mins, this.maxs, this.origin - '0 0 1', MOVE_NOMONSTERS, this);
        if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK)
        {
-               UNSET_ONGROUND(this);
+               if(PHYS_SLICK_APPLYGRAVITY(this))
+                       UNSET_ONGROUND(this);
                SET_ONSLICK(this);
        }
        else