Missing hit sounds
Spaceman created issue #240 (closed) on 2011-02-03T01:36:45Z:
When you hit a bot with The Nex or The Hagar you hear a nice hit sound, but when you use The Electro primary (the blue beam) or The Electro secondary (blue balls) you don’t. The hit sound also fails when you hit a bot using The Laser. Most odd.
If you hit a fellow team bot with The Electro primary (the blue beam), The Electro secondary (blue balls) or The Laser you DO hear the nasty team-hit sound. As expected.
I simple hack to restore the failing electro hit sound, change g_damage.qc approx line 790 from
if(damage > 0)
{
if(attacker.weapon != WEP_LASER
&& (attacker.weapon != WEP_ELECTRO || !autocvar_g_balance_electro_lightning)
&& attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
{
if(targ.BUTTON_CHAT)
attacker.typehitsound += 1;
else
attacker.hitsound += 1;
attacker.prevhitsound = time;
}
to take advantage of QC’s nested if’s
if(damage > 0)
{
if (attacker.weapon != WEP_LASER)
if (attacker.weapon != WEP_ELECTRO || !autocvar_g_balance_electro_lightning)
if (attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
{
if(targ.BUTTON_CHAT)
attacker.typehitsound += 1;
else
attacker.hitsound += 1;
attacker.prevhitsound = time;
}
and then remove a !
if(damage > 0)
{
if (attacker.weapon != WEP_LASER)
if (attacker.weapon != WEP_ELECTRO || autocvar_g_balance_electro_lightning)
if (attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
{
if(targ.BUTTON_CHAT)
attacker.typehitsound += 1;
else
attacker.hitsound += 1;
attacker.prevhitsound = time;
}
A better fix could involve a cvar (maybe set by the client) to control the number of hit sounds heard per second. This fix could also apply to The Uzi’s primary and especially The Uzi’s secondary.