Skip to content

Commit

Permalink
game: pmove_DoubleJump > pmove_RampJump
Browse files Browse the repository at this point in the history
quite buggy. vertical velocity always 0 when jumping

TODO FIX
  • Loading branch information
yumirak committed Mar 13, 2024
1 parent 5632214 commit cf24f50
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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},
Expand Down
6 changes: 3 additions & 3 deletions code/game/bg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions code/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions code/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions code/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit cf24f50

Please sign in to comment.