From 9536b5050b9161863c40c417c02aa52708091f12 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 16 Jul 2013 16:25:41 +0200 Subject: [PATCH] Fixes weapon input to use A_Use instead of hardcoding to mouse button --- apps/openmw/mwinput/inputmanagerimp.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index b9f1a67d4..fd2359f5c 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -161,6 +161,12 @@ namespace MWInput resetIdleTime (); int action = channel->getNumber(); + + if (action == A_Use) + { + MWWorld::Class::get(mPlayer.getPlayer()).getCreatureStats(mPlayer.getPlayer()).setAttackingOrSpell(currentValue); + } + if (currentValue == 1) { // trigger action activated @@ -522,8 +528,6 @@ namespace MWInput } } - MWWorld::Class::get(mPlayer.getPlayer()).getCreatureStats(mPlayer.getPlayer()).setAttackingOrSpell(true); - return true; } @@ -533,8 +537,6 @@ namespace MWInput MyGUI::InputManager::getInstance().injectMouseRelease(mMouseX, mMouseY, sdlButtonToMyGUI(id)); - MWWorld::Class::get(mPlayer.getPlayer()).getCreatureStats(mPlayer.getPlayer()).setAttackingOrSpell(false); - return true; }