From bf97fe7b35d078a8e97841fd263de4f5ecb8bbe2 Mon Sep 17 00:00:00 2001 From: Rohit Nirmal Date: Sat, 23 Aug 2014 10:31:10 -0500 Subject: [PATCH] Need to change draw state if use'd item is in player's right hand. --- apps/openmw/mwgui/quickkeysmenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index 67b8db71d1..8b3a75d61f 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -300,9 +300,9 @@ namespace MWGui { MWWorld::Ptr item = *button->getUserData(); MWBase::Environment::get().getWindowManager()->getInventoryWindow()->useItem(item); - + MWWorld::ContainerStoreIterator rightHand = store.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); // draw weapon only if the item *is* a weapon - if (item.getTypeName() == typeid(ESM::Weapon).name()) + if (rightHand != store.end() && item == *rightHand) { MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Weapon); }