From bbb54ea36dec5eb9f85354e14bddc948bf2b2c8a Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:33:02 +0200 Subject: [PATCH] Uses LoopSounds() parameters instead of just the alias --- code/fgame/entity.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/fgame/entity.cpp b/code/fgame/entity.cpp index 19159bfa..95fbb02e 100644 --- a/code/fgame/entity.cpp +++ b/code/fgame/entity.cpp @@ -3280,10 +3280,10 @@ void Entity::LoopSound(str sound_name, float volume, float min_dist, float max_d // Add the looping sound to the entity edict->s.loopSound = gi.soundindex(name, aliasstreamed); - edict->s.loopSoundVolume = aliasvolume; - edict->s.loopSoundMinDist = aliasmin_dist; - edict->s.loopSoundMaxDist = aliasmax_dist; - edict->s.loopSoundPitch = aliaspitch; + edict->s.loopSoundVolume = volume < 0 ? (aliasvolume) : (aliasvolume * volume); + edict->s.loopSoundMinDist = min_dist < 0 ? (aliasmin_dist) : (min_dist); + edict->s.loopSoundMaxDist = max_dist < 0 ? (aliasmax_dist) : (max_dist); + edict->s.loopSoundPitch = pitch < 0 ? (aliaspitch) : (aliaspitch * pitch); // Local sound will always be heard edict->s.loopSoundFlags = aliaschannel == CHAN_LOCAL;