diff --git a/code/game/bg_local.h b/code/game/bg_local.h index d3ede18..0b67651 100644 --- a/code/game/bg_local.h +++ b/code/game/bg_local.h @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define STEPSIZE 18 -#define JUMP_VELOCITY 270 +#define JUMP_VELOCITY 275 #define TIMER_LAND 130 #define TIMER_GESTURE (34*66+50) diff --git a/code/game/bg_pmove.c b/code/game/bg_pmove.c index 36bae08..9d1a188 100644 --- a/code/game/bg_pmove.c +++ b/code/game/bg_pmove.c @@ -383,6 +383,14 @@ qboolean PM_CanJump( void ) { return qfalse; } + // QL: 100ms minimum delay between jumps. + // Prevents same-frame double-fires. Step jumps launch the player + // high enough (~400ms airtime) that the next stair collision + // naturally exceeds this threshold. + if ( pm->cmd.serverTime - pm->ps->lastJumpTime < 100 ) { + return qfalse; + } + return qtrue; } diff --git a/code/game/bg_slidemove.c b/code/game/bg_slidemove.c index ed1349f..6c7b307 100644 --- a/code/game/bg_slidemove.c +++ b/code/game/bg_slidemove.c @@ -246,15 +246,9 @@ void PM_StepSlideMove( qboolean gravity ) { return; // we got exactly where we wanted to go first try } - VectorCopy(start_o, down); - down[2] -= STEPSIZE; - pm->trace (&trace, start_o, pm->mins, pm->maxs, down, pm->ps->clientNum, pm->tracemask); - VectorSet(up, 0, 0, 1); - // never step up when you still have up velocity - if ( pm->ps->velocity[2] > 0 && (trace.fraction == 1.0 || - DotProduct(trace.plane.normal, up) < 0.7)) { - return; - } + // QL pm_airSteps: allow step-ups with upward velocity. + // Q3 blocked step-ups during jumps unless ground was directly below. + // This prevented smooth stair traversal while bunny-hopping. VectorCopy (pm->ps->origin, down_o); VectorCopy (pm->ps->velocity, down_v); @@ -285,8 +279,14 @@ void PM_StepSlideMove( qboolean gravity ) { if ( !trace.allsolid ) { VectorCopy (trace.endpos, pm->ps->origin); } + // QL: only clip velocity to step surface when moving INTO it. + // Skip clip when velocity is already moving away (preserves + // upward momentum through stair steps during bunny-hopping). if ( trace.fraction < 1.0 ) { - PM_ClipVelocity( pm->ps->velocity, trace.plane.normal, pm->ps->velocity, OVERCLIP ); + float vdotn = DotProduct( pm->ps->velocity, trace.plane.normal ); + if ( vdotn < 0 || fabs( vdotn ) < 0.001f ) { + PM_ClipVelocity( pm->ps->velocity, trace.plane.normal, pm->ps->velocity, OVERCLIP ); + } } #if 0