From: Mario Date: Tue, 7 Jan 2020 16:57:11 +0000 (+1000) Subject: Make the slick flag usable outside of applygravity X-Git-Tag: xonotic-v0.8.5~1105^2~38 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e8f96d5f47aaced01a34dee4d590116e31838064;p=xonotic%2Fxonotic-data.pk3dir.git Make the slick flag usable outside of applygravity --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 9f7ddab50..02657dee8 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -690,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 diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index f73ade3d1..a5af98d2c 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -360,11 +360,9 @@ void sys_phys_simulate(entity this, float dt) // apply edge friction const float f2 = vlen2(vec2(this.velocity)); if (f2 > 0) { - trace_dphitq3surfaceflags = 0; - tracebox(this.origin, this.mins, this.maxs, this.origin - '0 0 1', MOVE_NOMONSTERS, this); // TODO: apply edge friction // apply ground friction - const int realfriction = (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK) + const int realfriction = (IS_ONSLICK(this)) ? PHYS_FRICTION_SLICK(this) : PHYS_FRICTION(this);