From c11774f2789f256229e26549e5759c3b107a3623 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 17 May 2021 12:23:56 +0400 Subject: [PATCH] Do not trigger in-game bindings via mouse buttons when controls are disabled (bug #6047) --- CHANGELOG.md | 1 + apps/openmw/mwinput/mousemanager.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 328b83852..9d5c97352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,6 +126,7 @@ Bug #6016: Greeting interrupts Fargoth's sneak-walk Bug #6028: Particle system controller values are incorrectly used Bug #6043: Actor can have torch missing when torch animation is played + Bug #6047: Mouse bindings can be triggered during save loading Feature #390: 3rd person look "over the shoulder" Feature #832: OpenMW-CS: Handle deleted references Feature #1536: Show more information about level on menu diff --git a/apps/openmw/mwinput/mousemanager.cpp b/apps/openmw/mwinput/mousemanager.cpp index a696332df..cf151dfac 100644 --- a/apps/openmw/mwinput/mousemanager.cpp +++ b/apps/openmw/mwinput/mousemanager.cpp @@ -144,7 +144,8 @@ namespace MWInput void MouseManager::mousePressed(const SDL_MouseButtonEvent &arg, Uint8 id) { - MWBase::Environment::get().getInputManager()->setJoystickLastUsed(false); + MWBase::InputManager* input = MWBase::Environment::get().getInputManager(); + input->setJoystickLastUsed(false); bool guiMode = false; if (id == SDL_BUTTON_LEFT || id == SDL_BUTTON_RIGHT) // MyGUI only uses these mouse events @@ -165,7 +166,8 @@ namespace MWInput mBindingsManager->setPlayerControlsEnabled(!guiMode); // Don't trigger any mouse bindings while in settings menu, otherwise rebinding controls becomes impossible - if (MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Settings) + // Also do not trigger bindings when input controls are disabled, e.g. during save loading + if (MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Settings && !input->controlsDisabled()) mBindingsManager->mousePressed(arg, id); }