rehlds / ReGameDLL_CS

Enhanced server-side GameDLL for Counter-Strike 1.6 (and CS: Condition Zero), offering new features and fixes.
https://rehlds.dev/docs/regamedll-cs
GNU General Public License v3.0
590 stars 203 forks source link

PM_PlayWaterSounds bugged... #1028

Open teddiboy opened 1 day ago

teddiboy commented 1 day ago

👉👈 Contact Details (optional)

No response

💡 Tell us more about your idea

I tested with mp_footsteps 0 and it mutes players footsteps and water on the server, but it doesn't mute the water sound for me (client) pl_wade1/2/3/4.wav . Any idea ? https://github.com/rehlds/ReGameDLL_CS/blob/7738142c69dc9726a99203f151b7794645890367/regamedll/pm_shared/pm_shared.cpp#L2747

void PM_PlayWaterSounds()
{
       // Added this thing by me
        if (pmove->multiplayer && !pmove->movevars->footsteps)
        return;

    // Did we enter or leave water?
    if (pmove->oldwaterlevel != 0)
    {
        if (pmove->waterlevel != 0)
            return;
    }
    else
    {
        if (pmove->waterlevel == 0)
            return;
    }

    switch (pmove->RandomLong(0, 3))
    {
    case 0: pmove->PM_PlaySound(CHAN_BODY, "player/pl_wade1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM); break;
    case 1: pmove->PM_PlaySound(CHAN_BODY, "player/pl_wade2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM); break;
    case 2: pmove->PM_PlaySound(CHAN_BODY, "player/pl_wade3.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM); break;
    case 3: pmove->PM_PlaySound(CHAN_BODY, "player/pl_wade4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM); break;
    }
}