From b5c79738f10822f0814e3244100ed5ade56bb99b Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 16 Jul 2015 19:56:09 +0200 Subject: [PATCH] Fix enchantments casting more than once per button press, broken by a1432b0255dd659 --- apps/openmw/mwmechanics/character.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 95546dca9..9ccee84f6 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -43,6 +43,7 @@ #include "../mwworld/class.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/esmstore.hpp" +#include "../mwworld/player.hpp" namespace { @@ -1169,6 +1170,10 @@ bool CharacterController::updateWeaponState() // Unset casting flag, otherwise pressing the mouse button down would // continue casting every frame if there is no animation mAttackingOrSpell = false; + if (mPtr == MWBase::Environment::get().getWorld()->getPlayerPtr()) + { + MWBase::Environment::get().getWorld()->getPlayer().setAttackingOrSpell(false); + } const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();