Skip to content

Commit

Permalink
game: add pmove_weapon(raise,drop)time
Browse files Browse the repository at this point in the history
  • Loading branch information
yumirak committed Mar 12, 2024
1 parent 22d9faa commit 51108bd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ vmCvar_t pmove_FlyAccel;
vmCvar_t pmove_WalkFriction;
vmCvar_t pmove_WaterFriction;
vmCvar_t pmove_FlyFriction;
vmCvar_t pmove_WeaponDropTime;
vmCvar_t pmove_WeaponRaiseTime;
vmCvar_t cg_pmove_msec;
vmCvar_t cg_cameraMode;
vmCvar_t cg_cameraOrbit;
Expand Down Expand Up @@ -412,6 +414,8 @@ static cvarTable_t cvarTable[] = {
{ &pmove_WalkFriction, "pmove_WalkFriction", "6", CVAR_SYSTEMINFO},
{ &pmove_WaterFriction, "pmove_WaterFriction", "1", CVAR_SYSTEMINFO},
{ &pmove_FlyFriction, "pmove_FlyFriction", "3", CVAR_SYSTEMINFO},
{ &pmove_WeaponDropTime, "pmove_WeaponDropTime", "200", CVAR_SYSTEMINFO},
{ &pmove_WeaponRaiseTime, "pmove_WeaponRaiseTime", "200", CVAR_SYSTEMINFO},
#ifdef MISSIONPACK
{ &cg_smallFont, "ui_smallFont", "0.25", CVAR_ARCHIVE},
{ &cg_bigFont, "ui_bigFont", "0.4", CVAR_ARCHIVE},
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 @@ -80,3 +80,5 @@ extern vmCvar_t pmove_FlyAccel;
extern vmCvar_t pmove_WalkFriction;
extern vmCvar_t pmove_WaterFriction;
extern vmCvar_t pmove_FlyFriction;
extern vmCvar_t pmove_WeaponDropTime;
extern vmCvar_t pmove_WeaponRaiseTime;
4 changes: 2 additions & 2 deletions code/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ static void PM_BeginWeaponChange( int weapon ) {

PM_AddEvent( EV_CHANGE_WEAPON );
pm->ps->weaponstate = WEAPON_DROPPING;
pm->ps->weaponTime += 200;
pm->ps->weaponTime += pmove_WeaponDropTime.integer; // Q3 = 200;
PM_StartTorsoAnim( TORSO_DROP );
}

Expand All @@ -1497,7 +1497,7 @@ static void PM_FinishWeaponChange( void ) {

pm->ps->weapon = weapon;
pm->ps->weaponstate = WEAPON_RAISING;
pm->ps->weaponTime += 250;
pm->ps->weaponTime += pmove_WeaponRaiseTime.integer; // Q3 = 250;
PM_StartTorsoAnim( TORSO_RAISE );
}

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 @@ -753,6 +753,8 @@ extern vmCvar_t pmove_FlyAccel;
extern vmCvar_t pmove_WalkFriction;
extern vmCvar_t pmove_WaterFriction;
extern vmCvar_t pmove_FlyFriction;
extern vmCvar_t pmove_WeaponDropTime;
extern vmCvar_t pmove_WeaponRaiseTime;
extern vmCvar_t g_rankings;
extern vmCvar_t g_enableDust;
extern vmCvar_t g_enableBreath;
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 @@ -88,6 +88,8 @@ vmCvar_t pmove_FlyAccel;
vmCvar_t pmove_WalkFriction;
vmCvar_t pmove_WaterFriction;
vmCvar_t pmove_FlyFriction;
vmCvar_t pmove_WeaponDropTime;
vmCvar_t pmove_WeaponRaiseTime;
vmCvar_t g_rankings;
vmCvar_t g_listEntity;
vmCvar_t g_localTeamPref;
Expand Down Expand Up @@ -285,6 +287,8 @@ static cvarTable_t gameCvarTable[] = {
{ &pmove_WaterFriction, "pmove_WaterFriction", "1", CVAR_SYSTEMINFO, 0, qfalse},
{ &pmove_FlyFriction, "pmove_FlyFriction", "3", CVAR_SYSTEMINFO, 0, qfalse},

{ &pmove_WeaponDropTime, "pmove_WeaponDropTime", "200", CVAR_SYSTEMINFO, 0, qfalse},
{ &pmove_WeaponRaiseTime, "pmove_WeaponRaiseTime", "200", 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 51108bd

Please sign in to comment.