mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Switch to weapon drawstate when creating a bound weapon (Fixes #2387)
This commit is contained in:
parent
48ea6286fd
commit
68de876051
1 changed files with 9 additions and 1 deletions
|
@ -54,9 +54,17 @@ void adjustBoundItem (const std::string& item, bool bound, const MWWorld::Ptr& a
|
||||||
{
|
{
|
||||||
if (actor.getClass().getContainerStore(actor).count(item) == 0)
|
if (actor.getClass().getContainerStore(actor).count(item) == 0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr newPtr = *actor.getClass().getContainerStore(actor).add(item, 1, actor);
|
MWWorld::InventoryStore& store = actor.getClass().getInventoryStore(actor);
|
||||||
|
MWWorld::Ptr newPtr = *store.MWWorld::ContainerStore::add(item, 1, actor);
|
||||||
MWWorld::ActionEquip action(newPtr);
|
MWWorld::ActionEquip action(newPtr);
|
||||||
action.execute(actor);
|
action.execute(actor);
|
||||||
|
MWWorld::ContainerStoreIterator rightHand = store.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
|
// change draw state only if the item is in player's right hand
|
||||||
|
if (actor == MWBase::Environment::get().getWorld()->getPlayerPtr()
|
||||||
|
&& rightHand != store.end() && newPtr == *rightHand)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWorld()->getPlayer().setDrawState(MWMechanics::DrawState_Weapon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue