CBasePlayer::WaterMove: No water sound playback occurs when clients emerge from network lag or was using noclip

This commit is contained in:
s1lentq 2024-01-31 17:40:47 +07:00
parent bde6aa07bc
commit a1af7ca426

View File

@ -3082,11 +3082,16 @@ void CBasePlayer::WaterMove()
// not underwater // not underwater
// play 'up for air' sound // play 'up for air' sound
if (pev->air_finished < gpGlobals->time) #ifdef REGAMEDLL_FIXES
EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade1.wav", VOL_NORM, ATTN_NORM); if (pev->flags & FL_INWATER)
#endif
{
if (pev->air_finished < gpGlobals->time)
EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade1.wav", VOL_NORM, ATTN_NORM);
else if (pev->air_finished < gpGlobals->time + 9) else if (pev->air_finished < gpGlobals->time + 9)
EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade2.wav", VOL_NORM, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade2.wav", VOL_NORM, ATTN_NORM);
}
pev->air_finished = gpGlobals->time + AIRTIME; pev->air_finished = gpGlobals->time + AIRTIME;
pev->dmg = 2; pev->dmg = 2;