From f0980805be165e62359d0becf6c42c0e79f24f8b Mon Sep 17 00:00:00 2001 From: Niklas Kersten Date: Wed, 11 Dec 2024 06:37:09 +0100 Subject: [PATCH] :bug: Ensure that limits of reverb parameters are not exceeded if timestep is too large --- source/main/audio/SoundManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/main/audio/SoundManager.cpp b/source/main/audio/SoundManager.cpp index 9ddf14b088..43ba24342f 100644 --- a/source/main/audio/SoundManager.cpp +++ b/source/main/audio/SoundManager.cpp @@ -526,7 +526,8 @@ void SoundManager::UpdateListenerEffectSlot(const float dt_sec) void SoundManager::SmoothlyUpdateAlAuxiliaryEffectSlot(const float dt_sec, const ALuint slot_id, const EFXEAXREVERBPROPERTIES* target_efx_properties) { const float time_to_target = 0.333f; // seconds to reach the target properties from the current properties - const float step = std::min(dt_sec / time_to_target, 1.0f); + // ensure to not exceed limits of reverb parameters if timestep is too large + const float step = std::min(dt_sec / time_to_target, 0.5f); static std::map current_efx_properties_of_slot; if (target_efx_properties == nullptr)