Skip to content

Commit

Permalink
CBasePlayer::WaterMove: No water sound playback occurs when clients e…
Browse files Browse the repository at this point in the history
…merge from network lag or was using noclip
  • Loading branch information
s1lentq committed Jan 31, 2024
1 parent bde6aa0 commit a1af7ca
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a1af7ca

Please sign in to comment.