From 3d8ca02479d42d9bd856d31254512dfb70f2428c Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Sat, 15 Feb 2014 17:39:11 +0100 Subject: [PATCH] Fix breaking of enchanted items casting --- apps/openmw/mwinput/inputmanagerimp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 7ed3007ffd..66d93469c7 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -17,6 +17,7 @@ #include "../mwworld/player.hpp" #include "../mwworld/class.hpp" +#include "../mwworld/inventorystore.hpp" #include "../mwbase/world.hpp" #include "../mwbase/windowmanager.hpp" #include "../mwbase/soundmanager.hpp" @@ -647,7 +648,9 @@ namespace MWInput return; // Not allowed if no spell selected - if (MWBase::Environment::get().getWindowManager()->getSelectedSpell().empty()) + MWWorld::InventoryStore& inventory = MWWorld::Class::get(mPlayer->getPlayer()).getInventoryStore(mPlayer->getPlayer()); + if (MWBase::Environment::get().getWindowManager()->getSelectedSpell().empty() && + inventory.getSelectedEnchantItem() == inventory.end()) return; MWMechanics::DrawState_ state = mPlayer->getDrawState();