forked from mirror/openmw-tes3mp
Reset player attack animation when unequip weapon or tool
This commit is contained in:
parent
a5b01fefec
commit
7f5f5458d4
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
#include "../mwworld/inventorystore.hpp"
|
#include "../mwworld/inventorystore.hpp"
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
#include "../mwworld/player.hpp"
|
||||||
|
|
||||||
#include "../mwmechanics/npcstats.hpp"
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
#include "../mwmechanics/actorutil.hpp"
|
#include "../mwmechanics/actorutil.hpp"
|
||||||
|
@ -919,6 +920,9 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
removeIndividualPart(ESM::PRT_Weapon);
|
removeIndividualPart(ESM::PRT_Weapon);
|
||||||
|
// If we remove/hide weapon from player, we should reset attack animation as well
|
||||||
|
if (mPtr == MWMechanics::getPlayer())
|
||||||
|
MWBase::Environment::get().getWorld()->getPlayer().setAttackingOrSpell(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue