Apply snd_gun and snd_long_pain options only to DDRace and FNG games

On 'traumatic' game types (e.g. vanilla dm, tdm, ctf) it is critical to
hear SOUND_GUN_FIRE (because someone seems to shooting at you).

It is not any less important to head SOUND_PLAYER_PAIN_LONG which takes
its place whenever the character taken damage > 2 (because you need to
know whether someone was hit).
This commit is contained in:
Alexander Akulich 2022-02-23 00:31:16 +03:00
parent c4e1754808
commit 0a30d8a058
2 changed files with 9 additions and 2 deletions

View file

@ -918,8 +918,13 @@ void CGameClient::ProcessEvents()
else if(Item.m_Type == NETEVENTTYPE_SOUNDWORLD)
{
CNetEvent_SoundWorld *ev = (CNetEvent_SoundWorld *)pData;
if(g_Config.m_SndGame && (ev->m_SoundID != SOUND_GUN_FIRE || g_Config.m_SndGun) && (ev->m_SoundID != SOUND_PLAYER_PAIN_LONG || g_Config.m_SndLongPain))
m_Sounds.PlayAt(CSounds::CHN_WORLD, ev->m_SoundID, 1.0f, vec2(ev->m_X, ev->m_Y));
if(!Config()->m_SndGame)
continue;
if(m_GameInfo.m_RaceSounds && ((ev->m_SoundID == SOUND_GUN_FIRE && !g_Config.m_SndGun) || (ev->m_SoundID == SOUND_PLAYER_PAIN_LONG && !g_Config.m_SndLongPain)))
continue;
m_Sounds.PlayAt(CSounds::CHN_WORLD, ev->m_SoundID, 1.0f, vec2(ev->m_X, ev->m_Y));
}
}
}
@ -996,6 +1001,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
Info.m_UnlimitedAmmo = Race;
Info.m_DDRaceRecordMessage = DDRace && !DDNet;
Info.m_RaceRecordMessage = DDNet || (Race && !DDRace);
Info.m_RaceSounds = DDRace || FNG;
Info.m_AllowEyeWheel = DDRace || BlockWorlds || City || Plus;
Info.m_AllowHookColl = DDRace;
Info.m_AllowZoom = Race || BlockWorlds || City;

View file

@ -63,6 +63,7 @@ public:
bool m_UnlimitedAmmo;
bool m_DDRaceRecordMessage;
bool m_RaceRecordMessage;
bool m_RaceSounds;
bool m_AllowEyeWheel;
bool m_AllowHookColl;