Skip to content

Commit

Permalink
game: add pmove_JumpVelocity
Browse files Browse the repository at this point in the history
also example for g to bg
  • Loading branch information
yumirak committed Mar 11, 2024
1 parent ae0e364 commit 66cdc98
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static qboolean PM_CheckJump( void ) {
pm->ps->pm_flags |= PMF_JUMP_HELD;

pm->ps->groundEntityNum = ENTITYNUM_NONE;
pm->ps->velocity[2] = JUMP_VELOCITY;
pm->ps->velocity[2] = pm->pmove_JumpVelocity; // JUMP_VELOCITY
PM_AddEvent( EV_JUMP );

if ( pm->cmd.forwardmove >= 0 ) {
Expand Down
2 changes: 2 additions & 0 deletions code/game/bg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ typedef struct {
int pmove_fixed;
int pmove_msec;

float pmove_JumpVelocity;

// callbacks to test the world
// these will be different functions during game and cgame
void (*trace)( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask );
Expand Down
1 change: 1 addition & 0 deletions code/game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ void ClientThink_real( gentity_t *ent ) {

pm.pmove_fixed = pmove_fixed.integer | client->pers.pmoveFixed;
pm.pmove_msec = pmove_msec.integer;
pm.pmove_JumpVelocity = pmove_JumpVelocity.value;

VectorCopy( client->ps.origin, client->oldOrigin );

Expand Down
1 change: 1 addition & 0 deletions code/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ extern vmCvar_t g_blueteam;
extern vmCvar_t g_smoothClients;
extern vmCvar_t pmove_fixed;
extern vmCvar_t pmove_msec;
extern vmCvar_t pmove_JumpVelocity;
extern vmCvar_t g_rankings;
extern vmCvar_t g_enableDust;
extern vmCvar_t g_enableBreath;
Expand Down
2 changes: 2 additions & 0 deletions code/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ vmCvar_t g_filterBan;
vmCvar_t g_smoothClients;
vmCvar_t pmove_fixed;
vmCvar_t pmove_msec;
vmCvar_t pmove_JumpVelocity;
vmCvar_t g_rankings;
vmCvar_t g_listEntity;
vmCvar_t g_localTeamPref;
Expand Down Expand Up @@ -266,6 +267,7 @@ static cvarTable_t gameCvarTable[] = {
{ &g_smoothClients, "g_smoothClients", "1", 0, 0, qfalse},
{ &pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO, 0, qfalse},
{ &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse},
{ &pmove_JumpVelocity, "pmove_JumpVelocity", "275", CVAR_SYSTEMINFO, 0, qfalse},

{ &g_rankings, "g_rankings", "0", 0, 0, qfalse},
{ &g_localTeamPref, "g_localTeamPref", "", 0, 0, qfalse },
Expand Down

0 comments on commit 66cdc98

Please sign in to comment.