Skip to content

Commit

Permalink
game: add pmove_StepJump(Velocity)
Browse files Browse the repository at this point in the history
  • Loading branch information
yumirak committed Mar 12, 2024
1 parent 352ccb9 commit 5632214
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ vmCvar_t pmove_JumpVelocityScaleAdd;
vmCvar_t pmove_JumpVelocityTimeThreshold;
vmCvar_t pmove_DoubleJump;
vmCvar_t pmove_StepHeight;
vmCvar_t pmove_StepJump;
vmCvar_t pmove_StepJumpVelocity;
vmCvar_t pmove_Overbounce;
vmCvar_t pmove_WishSpeed;
vmCvar_t pmove_WalkAccel;
Expand Down Expand Up @@ -417,6 +419,8 @@ static cvarTable_t cvarTable[] = {
{ &pmove_JumpVelocityTimeThreshold, "pmove_JumpVelocityTimeThreshold", "500.0", CVAR_SYSTEMINFO},
{ &pmove_DoubleJump, "pmove_DoubleJump", "0", CVAR_SYSTEMINFO},
{ &pmove_StepHeight, "pmove_StepHeight", "22", CVAR_SYSTEMINFO},
{ &pmove_StepJump, "pmove_StepJump", "1", CVAR_SYSTEMINFO},
{ &pmove_StepJumpVelocity, "pmove_StepJumpVelocity", "48", CVAR_SYSTEMINFO},
{ &pmove_Overbounce, "pmove_Overbounce", "0", CVAR_SYSTEMINFO},
{ &pmove_WishSpeed, "pmove_WishSpeed", "400", CVAR_SYSTEMINFO},
{ &pmove_WalkAccel, "pmove_WalkAccel", "10", CVAR_SYSTEMINFO},
Expand Down
2 changes: 2 additions & 0 deletions code/game/bg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ extern vmCvar_t pmove_JumpVelocityScaleAdd;
extern vmCvar_t pmove_JumpVelocityTimeThreshold;
extern vmCvar_t pmove_DoubleJump;
extern vmCvar_t pmove_StepHeight;
extern vmCvar_t pmove_StepJump;
extern vmCvar_t pmove_StepJumpVelocity;
extern vmCvar_t pmove_Overbounce;
extern vmCvar_t pmove_WishSpeed;
extern vmCvar_t pmove_WalkAccel;
Expand Down
6 changes: 3 additions & 3 deletions code/game/bg_slidemove.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ void PM_StepSlideMove( qboolean gravity ) {
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)) {
if( (trace.fraction == 1.0 || DotProduct(trace.plane.normal, up) < 0.7)
&& !(pm->ps->velocity[2] < pmove_StepJumpVelocity.value && pmove_StepJump.integer)
)
return;
}

//VectorCopy (pm->ps->origin, down_o);
//VectorCopy (pm->ps->velocity, down_v);
Expand Down
2 changes: 2 additions & 0 deletions code/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ extern vmCvar_t pmove_JumpVelocityScaleAdd;
extern vmCvar_t pmove_JumpVelocityTimeThreshold;
extern vmCvar_t pmove_DoubleJump;
extern vmCvar_t pmove_StepHeight;
extern vmCvar_t pmove_StepJump;
extern vmCvar_t pmove_StepJumpVelocity;
extern vmCvar_t pmove_Overbounce;
extern vmCvar_t pmove_WishSpeed;
extern vmCvar_t pmove_WalkAccel;
Expand Down
4 changes: 4 additions & 0 deletions code/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ vmCvar_t pmove_JumpVelocityScaleAdd;
vmCvar_t pmove_JumpVelocityTimeThreshold;
vmCvar_t pmove_DoubleJump;
vmCvar_t pmove_StepHeight;
vmCvar_t pmove_StepJump;
vmCvar_t pmove_StepJumpVelocity;
vmCvar_t pmove_Overbounce;
vmCvar_t pmove_WishSpeed;
vmCvar_t pmove_WalkAccel;
Expand Down Expand Up @@ -290,6 +292,8 @@ static cvarTable_t gameCvarTable[] = {
{ &pmove_JumpVelocityTimeThreshold, "pmove_JumpVelocityTimeThreshold", "500.0", CVAR_SYSTEMINFO, 0, qfalse},
{ &pmove_DoubleJump, "pmove_DoubleJump", "0", 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},
{ &pmove_Overbounce, "pmove_Overbounce", "0", CVAR_SYSTEMINFO, 0, qfalse},

{ &pmove_WalkAccel, "pmove_WalkAccel", "10", CVAR_SYSTEMINFO,0, qfalse},
Expand Down

0 comments on commit 5632214

Please sign in to comment.