Skip to content

Commit

Permalink
cgame: Add cg_playHitSound cvar, turn on or off the q3 hit 'ping'
Browse files Browse the repository at this point in the history
  • Loading branch information
LegendaryGuard committed May 31, 2024
1 parent fa541d5 commit 19eb1bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/bfp_cvars_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
- cg_explosionSmoke [0/1]: turn on or off the explosion smoke.
- cg_explosionRing [0/1]: turn on or off the explosion ring.
- cg_particles [0/1]: turn on or off particle effects.
- cg_playHitSound [0/1]: turn on or off the q3 hit "ping".


## COMPLETED:
Expand All @@ -67,6 +66,7 @@
- [x] ~~cg_lightweightAuras~~
- [x] ~~cg_polygonAura~~
- [x] ~~cg_highPolyAura~~
- [x] ~~cg_playHitSound~~
- [x] ~~g_noFlight (disables "fly" bind too, original BFP has a leak though)~~
- [x] ~~g_blockLength~~
- [x] ~~g_blockDelay~~
Expand Down
1 change: 1 addition & 0 deletions source/cgame/cg_cvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ CG_CVAR( cg_tracerChance, "cg_tracerchance", "0.4", CVAR_CHEAT )
CG_CVAR( cg_tracerWidth, "cg_tracerwidth", "1", CVAR_CHEAT )
CG_CVAR( cg_tracerLength, "cg_tracerlength", "100", CVAR_CHEAT )
CG_CVAR( cg_flytilt, "cg_flytilt", "1", CVAR_ARCHIVE ) // BFP - Fly tilt
CG_CVAR( cg_playHitSound, "cg_playHitSound", "0", CVAR_ARCHIVE ) // BFP - Play hit sound
CG_CVAR( cg_thirdPersonRange, "cg_thirdPersonRange", "110", CVAR_ARCHIVE ) // BFP
CG_CVAR( cg_thirdPersonAngle, "cg_thirdPersonAngle", "0", CVAR_ARCHIVE ) // BFP
CG_CVAR( cg_thirdPersonHeight, "cg_thirdPersonHeight", "-60", CVAR_ARCHIVE ) // BFP - Camera height
Expand Down
5 changes: 4 additions & 1 deletion source/cgame/cg_playerstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
cg.opponentHitBlendTime = cg.time + 0.5f; // BFP - For crosshair opponent hit effect
armor = ps->persistant[PERS_ATTACKEE_ARMOR] & 0xff;
health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8;
trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND );
// BFP - Play hit sound
if ( cg_playHitSound.integer > 0 ) {
trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND );
}
} else if ( ps->persistant[PERS_HITS] < ops->persistant[PERS_HITS] ) {
trap_S_StartLocalSound( cgs.media.hitTeamSound, CHAN_LOCAL_SOUND );
}
Expand Down

0 comments on commit 19eb1bc

Please sign in to comment.