From aa249543c2d4cda32fa8da19f1c34cd18d30654a Mon Sep 17 00:00:00 2001 From: Gregg <82627200+Kokoc9n@users.noreply.github.com> Date: Mon, 11 Mar 2024 04:08:05 +1100 Subject: [PATCH] Cherry-picked commit e47f84568eec53efd66fca6e79d8c594a508cf3c from space-wizards/space-station-14/master --- Content.Client/Audio/ContentAudioSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Client/Audio/ContentAudioSystem.cs b/Content.Client/Audio/ContentAudioSystem.cs index c7fc7bcf739..f62b34b492c 100644 --- a/Content.Client/Audio/ContentAudioSystem.cs +++ b/Content.Client/Audio/ContentAudioSystem.cs @@ -107,7 +107,7 @@ public void FadeIn(EntityUid? stream, AudioComponent? component = null, float du _fadingOut.Remove(stream.Value); var curVolume = component.Volume; - var change = (curVolume - MinVolume) / duration; + var change = (MinVolume - curVolume) / duration; _fadingIn.Add(stream.Value, (change, component.Volume)); component.Volume = MinVolume; } @@ -151,8 +151,8 @@ private void UpdateFades(float frameTime) continue; } - var volume = component.Volume + change * frameTime; - volume = MathF.Max(target, volume); + var volume = component.Volume - change * frameTime; + volume = MathF.Min(target, volume); _audio.SetVolume(stream, volume, component); if (component.Volume.Equals(target))