From: terencehill Date: Thu, 18 Apr 2024 17:35:13 +0000 (+0200) Subject: Fix inconsistent jumps on jumppads controlled by a trigger_multiple entity when playe... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fterencehill%2Fstepdown_with_jumppad-fix;p=xonotic%2Fxonotic-data.pk3dir.git Fix inconsistent jumps on jumppads controlled by a trigger_multiple entity when player walks towards them With such jumppads the push event happens only once (unlike conventional jumppads) so sv_gameplayfix_stepdown 2 immediate and unwanted speed change was preserved whereas with conventional jumppads the next push events override that speed change --- diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index 5ded24a28..ab632d921 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -386,6 +386,7 @@ bool jumppad_push(entity this, entity targ, bool is_velocity_pad) { targ.(jumppadsused[targ.jumppadcount % NUM_JUMPPADSUSED]) = this; targ.jumppadcount = targ.jumppadcount + 1; + targ.jumppad_first_push = true; } if(IS_REAL_CLIENT(targ)) diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qh b/qcsrc/common/mapobjects/trigger/jumppads.qh index 54366ddf4..e2b570764 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qh +++ b/qcsrc/common/mapobjects/trigger/jumppads.qh @@ -27,6 +27,7 @@ STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); } const int NUM_JUMPPADSUSED = 3; .float jumppadcount; .entity jumppadsused[NUM_JUMPPADSUSED]; +.bool jumppad_first_push; #ifdef SVQC void SUB_UseTargets(entity this, entity actor, entity trigger); diff --git a/qcsrc/common/physics/movetypes/walk.qc b/qcsrc/common/physics/movetypes/walk.qc index 868bf6d35..2f2cca280 100644 --- a/qcsrc/common/physics/movetypes/walk.qc +++ b/qcsrc/common/physics/movetypes/walk.qc @@ -172,7 +172,7 @@ void _Movetype_Physics_Walk(entity this, float dt) // SV_WalkMove // up while already jumping (also known as the Quake2 double jump bug) // LordHavoc: disabled this check so you can walk on monsters/players //if (PRVM_serveredictfloat(ent, solid) == SOLID_BSP) - if(GAMEPLAYFIX_STEPDOWN(this) == 2) + if(GAMEPLAYFIX_STEPDOWN(this) == 2 && !this.jumppad_first_push) { SET_ONGROUND(this); this.groundentity = trace_ent; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index c1ee3aceb..4ed733785 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2541,7 +2541,7 @@ void DrownPlayer(entity this) } .bool move_qcphysics; - +.bool jumppad_first_push; void Player_Physics(entity this) { this.movetype = (this.move_qcphysics) ? MOVETYPE_QCPLAYER : this.move_movetype; @@ -2555,6 +2555,9 @@ void Player_Physics(entity this) Movetype_Physics_NoMatchTicrate(this, CS(this).pm_frametime, true); CS(this).pm_frametime = 0; + + if (this.jumppad_first_push) + this.jumppad_first_push = false; } /*