mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
Need to change draw state if use'd item is in player's right hand.
This commit is contained in:
parent
234903d93c
commit
bf97fe7b35
@ -300,9 +300,9 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
MWWorld::Ptr item = *button->getUserData<MWWorld::Ptr>();
|
MWWorld::Ptr item = *button->getUserData<MWWorld::Ptr>();
|
||||||
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->useItem(item);
|
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
|
// 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);
|
MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Weapon);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user