]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix inconsistent jumps on jumppads controlled by a trigger_multiple entity when playe... terencehill/stepdown_with_jumppad-fix
authorterencehill <piuntn@gmail.com>
Thu, 18 Apr 2024 17:35:13 +0000 (19:35 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 18 Apr 2024 17:35:13 +0000 (19:35 +0200)
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

qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/common/mapobjects/trigger/jumppads.qh
qcsrc/common/physics/movetypes/walk.qc
qcsrc/server/client.qc

index 5ded24a28c0b27559110e9164c308c845061270d..ab632d92150a029fbed5b74dc1337116d70cb132 100644 (file)
@@ -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))
index 54366ddf4b290df1c97b99ddf607b474ad2c4a6e..e2b5707643fb5c664be8b42a5d9a575da1d12404 100644 (file)
@@ -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);
index 868bf6d35873192a3ffffd39a29aab4dfb80836c..2f2cca2804061725a1ad48a2e61d2d54252ac2cb 100644 (file)
@@ -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;
index c1ee3aceb39780f2b3ede953fd45ff0aac798c60..4ed73378531913519a01489dc51e1d0d3a5f6834 100644 (file)
@@ -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;
 }
 
 /*