mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
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:
parent
c4e1754808
commit
0a30d8a058
|
@ -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;
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
bool m_UnlimitedAmmo;
|
||||
bool m_DDRaceRecordMessage;
|
||||
bool m_RaceRecordMessage;
|
||||
bool m_RaceSounds;
|
||||
|
||||
bool m_AllowEyeWheel;
|
||||
bool m_AllowHookColl;
|
||||
|
|
Loading…
Reference in a new issue