Merge pull request #12207 from malleoz/decrease_emulation_speed_rollover_fix

DolphinQt: Fix decrease emulation speed hotkey rollover
This commit is contained in:
Admiral H. Curtiss 2023-09-28 21:55:15 +02:00 committed by GitHub
commit a310b32525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -470,8 +470,11 @@ void HotkeyScheduler::Run()
if (IsHotkey(HK_DECREASE_EMULATION_SPEED)) if (IsHotkey(HK_DECREASE_EMULATION_SPEED))
{ {
auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) - 0.1; auto speed = Config::Get(Config::MAIN_EMULATION_SPEED) - 0.1;
speed = (speed <= 0 || (speed >= 0.95 && speed <= 1.05)) ? 1.0 : speed; if (speed > 0)
Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed); {
speed = (speed >= 0.95 && speed <= 1.05) ? 1.0 : speed;
Config::SetCurrent(Config::MAIN_EMULATION_SPEED, speed);
}
ShowEmulationSpeed(); ShowEmulationSpeed();
} }