From a1af7ca4260f6f6f5a8d795d654efe91d7603ff5 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 31 Jan 2024 17:40:47 +0700 Subject: [PATCH] CBasePlayer::WaterMove: No water sound playback occurs when clients emerge from network lag or was using noclip --- regamedll/dlls/player.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 0bc4e4fc..fd8b507e 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -3082,11 +3082,16 @@ void CBasePlayer::WaterMove() // not underwater // play 'up for air' sound - if (pev->air_finished < gpGlobals->time) - EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade1.wav", VOL_NORM, ATTN_NORM); +#ifdef REGAMEDLL_FIXES + 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) - EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade2.wav", VOL_NORM, ATTN_NORM); + else if (pev->air_finished < gpGlobals->time + 9) + EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/pl_wade2.wav", VOL_NORM, ATTN_NORM); + } pev->air_finished = gpGlobals->time + AIRTIME; pev->dmg = 2;