cl_ambientsound scales volume instead of bool

- Limited 1x scale because people have 2 in their configs from last patch.
This commit is contained in:
pierow 2021-01-20 17:55:40 -05:00
parent 95d0c38fdc
commit 50930aaa6e
1 changed files with 5 additions and 9 deletions

View File

@ -101,15 +101,11 @@ void AvHAmbientSound::UpdateVolume(const Vector& inListenerPosition)
theVolume = this->mVolume - this->mVolume*(theDistance/(float)this->mFadeDistance);
}
if (CVAR_GET_FLOAT("cl_ambientsound") != 1.0f)
{
theVolume = 0;
}
else
{
theVolume = min(max(0, theVolume), 255);
}
float ambientscale = (CVAR_GET_FLOAT("cl_ambientsound"));
ambientscale = min(max(0, ambientscale), 1);
theVolume = min(max(0, theVolume), 255);
theVolume *= ambientscale;
FMOD_INSTANCE* theFMOD = gHUD.GetFMOD();
if (theFMOD)