options_menu: only play slider sound between min/max range

This commit is contained in:
Hyper 2024-11-19 13:14:57 +00:00
parent f4bae353a4
commit eeb428d9de

View file

@ -655,10 +655,10 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
deltaTime -= INCREMENT_TIME; deltaTime -= INCREMENT_TIME;
} while (fastIncrement && deltaTime > 0.0f); } while (fastIncrement && deltaTime > 0.0f);
config->Value = std::clamp(config->Value, valueMin, valueMax); if ((increment || decrement) && (config->Value >= valueMin && config->Value <= valueMax))
if (increment || decrement)
PlaySound("sys_actstg_twn_speechbutton"); PlaySound("sys_actstg_twn_speechbutton");
config->Value = std::clamp(config->Value, valueMin, valueMax);
} }
if (config->Callback) if (config->Callback)