FPS independent alien movement sounds

This commit is contained in:
pierow 2018-06-06 18:56:58 -04:00
parent 38e748c26a
commit b3fcf00ea8

View file

@ -9329,8 +9329,8 @@ void AvHPlayer::UpdateAmbientSounds()
int theBaseSpeed, theMaxSpeed; int theBaseSpeed, theMaxSpeed;
this->GetSpeeds(theBaseSpeed, theMaxSpeed); this->GetSpeeds(theBaseSpeed, theMaxSpeed);
float theAlienSoundFreq = 0.003f; float theAlienSoundFreq = 0.3f;
float theChanceOfPlayingSound = theAlienSoundFreq*(theVelocity/((float)theMaxSpeed)); float theChanceOfPlayingSound = gpGlobals->frametime*theAlienSoundFreq*(theVelocity/((float)theMaxSpeed));
if(RANDOM_FLOAT(0, 1) < theChanceOfPlayingSound) if(RANDOM_FLOAT(0, 1) < theChanceOfPlayingSound)
{ {
float theVolume = RANDOM_FLOAT(.5, 1.0)*theSilenceVolumeFactor; float theVolume = RANDOM_FLOAT(.5, 1.0)*theSilenceVolumeFactor;