From 163dc9618a92665f12621a5d7f891f2d77564db1 Mon Sep 17 00:00:00 2001 From: vperus Date: Tue, 10 Mar 2026 03:18:18 +0200 Subject: [PATCH] Replace (std::min + std::max) with std::clamp --- src/audio/spell_sound_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio/spell_sound_manager.cpp b/src/audio/spell_sound_manager.cpp index 255e83bf..4c024b88 100644 --- a/src/audio/spell_sound_manager.cpp +++ b/src/audio/spell_sound_manager.cpp @@ -2,6 +2,7 @@ #include "audio/audio_engine.hpp" #include "pipeline/asset_manager.hpp" #include "core/logger.hpp" +#include #include namespace wowee { @@ -180,7 +181,7 @@ void SpellSoundManager::playRandomSound(const std::vector& library, } void SpellSoundManager::setVolumeScale(float scale) { - volumeScale_ = std::max(0.0f, std::min(1.0f, scale)); + volumeScale_ = std::clamp(scale, .0f, 1.f); } void SpellSoundManager::playPrecast(MagicSchool school, SpellPower power) {