From cf24f506044249f15e99c41af34d39a6486db272 Mon Sep 17 00:00:00 2001 From: yumirak Date: Wed, 13 Mar 2024 12:55:13 +0700 Subject: [PATCH] game: pmove_DoubleJump > pmove_RampJump quite buggy. vertical velocity always 0 when jumping TODO FIX --- code/cgame/cg_main.c | 12 ++++++------ code/game/bg_local.h | 6 +++--- code/game/bg_pmove.c | 8 ++++---- code/game/g_local.h | 6 +++--- code/game/g_main.c | 12 ++++++------ 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 7b7e2bb40f..1f17f04712 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -185,9 +185,9 @@ vmCvar_t pmove_fixed; vmCvar_t pmove_msec; vmCvar_t pmove_JumpVelocity; vmCvar_t pmove_JumpVelocityMax; -vmCvar_t pmove_JumpVelocityScaleAdd; -vmCvar_t pmove_JumpVelocityTimeThreshold; -vmCvar_t pmove_DoubleJump; +vmCvar_t pmove_RampJump; +vmCvar_t pmove_RampJumpScale; +vmCvar_t pmove_RampJumpTime; vmCvar_t pmove_StepHeight; vmCvar_t pmove_StepJump; vmCvar_t pmove_StepJumpVelocity; @@ -415,9 +415,9 @@ static cvarTable_t cvarTable[] = { { &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO}, { &pmove_JumpVelocity, "pmove_JumpVelocity", "275", CVAR_SYSTEMINFO}, { &pmove_JumpVelocityMax, "pmove_JumpVelocityMax", "700", CVAR_SYSTEMINFO}, - { &pmove_JumpVelocityScaleAdd, "pmove_JumpVelocityScaleAdd", "275", CVAR_SYSTEMINFO}, - { &pmove_JumpVelocityTimeThreshold, "pmove_JumpVelocityTimeThreshold", "500.0", CVAR_SYSTEMINFO}, - { &pmove_DoubleJump, "pmove_DoubleJump", "0", CVAR_SYSTEMINFO}, + { &pmove_RampJump, "pmove_RampJump", "0", CVAR_SYSTEMINFO}, + { &pmove_RampJumpScale, "pmove_RampJumpScale", "1.0"", CVAR_SYSTEMINFO}, + { &pmove_RampJumpTime, "pmove_RampJumpTime", "500", CVAR_SYSTEMINFO}, { &pmove_StepHeight, "pmove_StepHeight", "22", CVAR_SYSTEMINFO}, { &pmove_StepJump, "pmove_StepJump", "1", CVAR_SYSTEMINFO}, { &pmove_StepJumpVelocity, "pmove_StepJumpVelocity", "48", CVAR_SYSTEMINFO}, diff --git a/code/game/bg_local.h b/code/game/bg_local.h index d474e3fcec..12619bbd11 100644 --- a/code/game/bg_local.h +++ b/code/game/bg_local.h @@ -73,9 +73,9 @@ void PM_StepSlideMove( qboolean gravity ); extern vmCvar_t pmove_JumpVelocity; extern vmCvar_t pmove_JumpVelocityMax; -extern vmCvar_t pmove_JumpVelocityScaleAdd; -extern vmCvar_t pmove_JumpVelocityTimeThreshold; -extern vmCvar_t pmove_DoubleJump; +extern vmCvar_t pmove_RampJump; +extern vmCvar_t pmove_RampJumpScale; +extern vmCvar_t pmove_RampJumpTime; extern vmCvar_t pmove_StepHeight; extern vmCvar_t pmove_StepJump; extern vmCvar_t pmove_StepJumpVelocity; diff --git a/code/game/bg_pmove.c b/code/game/bg_pmove.c index e31da525e9..dc7118e53b 100644 --- a/code/game/bg_pmove.c +++ b/code/game/bg_pmove.c @@ -372,16 +372,16 @@ static qboolean PM_CheckJump( void ) { pm->ps->groundEntityNum = ENTITYNUM_NONE; pm->ps->velocity[2] = pmove_JumpVelocity.value; // JUMP_VELOCITY // Double jump - if (pmove_DoubleJump.integer) { + if (pmove_RampJump.integer) { float jump_zvel; jump_zvel = Com_Clamp( 0, pmove_JumpVelocityMax.value, - pm->ps->velocity[2] * pmove_JumpVelocityScaleAdd.value); + pm->ps->velocity[2] * pmove_RampJumpScale.value); if (pm->ps->stats[STAT_JUMPTIME] > 0) pm->ps->velocity[2] += jump_zvel; } - pm->ps->stats[STAT_JUMPTIME] = pmove_JumpVelocityTimeThreshold.value; + pm->ps->stats[STAT_JUMPTIME] = pmove_RampJumpTime.value; PM_AddEvent( EV_JUMP ); if ( pm->cmd.forwardmove >= 0 ) { @@ -774,7 +774,7 @@ static void PM_WalkMove( void ) { // when a player gets hit, they temporarily lose // full control, which allows them to be moved a bit - if ( ( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) { + if ( (( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) && !pmove_RampJump.integer) { accelerate = pmove_AirAccel.value; } else { accelerate = pmove_WalkAccel.value; diff --git a/code/game/g_local.h b/code/game/g_local.h index aecc462653..fd20206ea3 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -746,9 +746,9 @@ extern vmCvar_t pmove_fixed; extern vmCvar_t pmove_msec; extern vmCvar_t pmove_JumpVelocity; extern vmCvar_t pmove_JumpVelocityMax; -extern vmCvar_t pmove_JumpVelocityScaleAdd; -extern vmCvar_t pmove_JumpVelocityTimeThreshold; -extern vmCvar_t pmove_DoubleJump; +extern vmCvar_t pmove_RampJump; +extern vmCvar_t pmove_RampJumpScale; +extern vmCvar_t pmove_RampJumpTime; extern vmCvar_t pmove_StepHeight; extern vmCvar_t pmove_StepJump; extern vmCvar_t pmove_StepJumpVelocity; diff --git a/code/game/g_main.c b/code/game/g_main.c index cac3bed512..046881e7b8 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -81,9 +81,9 @@ vmCvar_t pmove_fixed; vmCvar_t pmove_msec; vmCvar_t pmove_JumpVelocity; vmCvar_t pmove_JumpVelocityMax; -vmCvar_t pmove_JumpVelocityScaleAdd; -vmCvar_t pmove_JumpVelocityTimeThreshold; -vmCvar_t pmove_DoubleJump; +vmCvar_t pmove_RampJump; +vmCvar_t pmove_RampJumpScale; +vmCvar_t pmove_RampJumpTime; vmCvar_t pmove_StepHeight; vmCvar_t pmove_StepJump; vmCvar_t pmove_StepJumpVelocity; @@ -288,9 +288,9 @@ static cvarTable_t gameCvarTable[] = { { &pmove_WishSpeed, "pmove_WishSpeed", "400", CVAR_SYSTEMINFO,0, qfalse}, { &pmove_JumpVelocity, "pmove_JumpVelocity", "275", CVAR_SYSTEMINFO, 0, qfalse}, { &pmove_JumpVelocityMax, "pmove_JumpVelocityMax", "700", CVAR_SYSTEMINFO, 0, qfalse}, - { &pmove_JumpVelocityScaleAdd, "pmove_JumpVelocityScaleAdd", "0.4", CVAR_SYSTEMINFO, 0, qfalse}, - { &pmove_JumpVelocityTimeThreshold, "pmove_JumpVelocityTimeThreshold", "500.0", CVAR_SYSTEMINFO, 0, qfalse}, - { &pmove_DoubleJump, "pmove_DoubleJump", "0", CVAR_SYSTEMINFO, 0, qfalse}, + { &pmove_RampJump, "pmove_RampJump", "0", CVAR_SYSTEMINFO, 0, qfalse}, + { &pmove_RampJumpScale, "pmove_RampJumpScale", "1.0"", CVAR_SYSTEMINFO, 0, qfalse}, + { &pmove_RampJumpTime, "pmove_RampJumpTime", "500", CVAR_SYSTEMINFO, 0, qfalse}, { &pmove_StepHeight, "pmove_StepHeight", "22", CVAR_SYSTEMINFO, 0, qfalse}, { &pmove_StepJump, "pmove_StepJump", "1", CVAR_SYSTEMINFO, 0, qfalse}, { &pmove_StepJumpVelocity, "pmove_StepJumpVelocity", "48", CVAR_SYSTEMINFO, 0, qfalse},