mirror of
https://github.com/ENSL/NS.git
synced 2025-02-18 10:01:22 +00:00
FPS independent alien movement sounds
This commit is contained in:
parent
38e748c26a
commit
b3fcf00ea8
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue