From 4894a664280a931b4b564367dd2bcb9df0f6dcbb Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Thu, 3 Feb 2022 18:30:56 +0100 Subject: [PATCH] Capped sound volume --- Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs | 2 +- Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs index 4198136b73..434f6704d7 100644 --- a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = (int)MaxTime; var sound = Main.PlaySound(Charge > 0 ? SoundID.DD2_PhantomPhoenixShot : SoundID.DD2_MonkStaffSwing, projectile.Center); if (Charge > 0) - sound.Volume *= 2.5f; + sound.Volume = MathHelper.Clamp(sound.Volume * 2.5f, 0f, 1f); direction = projectile.velocity; direction.Normalize(); projectile.rotation = direction.ToRotation(); diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index 1108ec17fe..f53905590f 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = (int)MaxTime; var sound = Main.PlaySound(Charge > 0 ? SoundID.DD2_PhantomPhoenixShot : SoundID.DD2_MonkStaffSwing, projectile.Center); if (Charge > 0) - sound.Volume *= 2.5f; + sound.Volume = MathHelper.Clamp(sound.Volume * 2.5f, 0f, 1f); direction = projectile.velocity; direction.Normalize(); projectile.rotation = direction.ToRotation();