mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 05:53:50 +00:00
Merge pull request #2569 from akortunov/holstered_shield
Ignore shields sheathing for creatures without sheathing bone
This commit is contained in:
commit
1f616c5613
1 changed files with 20 additions and 15 deletions
|
@ -111,25 +111,30 @@ bool ActorAnimation::updateCarriedLeftVisible(const int weaptype) const
|
||||||
MWMechanics::CreatureStats &stats = cls.getCreatureStats(mPtr);
|
MWMechanics::CreatureStats &stats = cls.getCreatureStats(mPtr);
|
||||||
if (cls.hasInventoryStore(mPtr) && weaptype != ESM::Weapon::Spell)
|
if (cls.hasInventoryStore(mPtr) && weaptype != ESM::Weapon::Spell)
|
||||||
{
|
{
|
||||||
const MWWorld::InventoryStore& inv = cls.getInventoryStore(mPtr);
|
SceneUtil::FindByNameVisitor findVisitor ("Bip01 AttachShield");
|
||||||
const MWWorld::ConstContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
mObjectRoot->accept(findVisitor);
|
||||||
const MWWorld::ConstContainerStoreIterator shield = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
if (findVisitor.mFoundNode)
|
||||||
if (shield != inv.end() && shield->getTypeName() == typeid(ESM::Armor).name() && !getShieldMesh(*shield).empty())
|
|
||||||
{
|
{
|
||||||
if(stats.getDrawState() != MWMechanics::DrawState_Weapon)
|
const MWWorld::InventoryStore& inv = cls.getInventoryStore(mPtr);
|
||||||
return false;
|
const MWWorld::ConstContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
|
const MWWorld::ConstContainerStoreIterator shield = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||||
if (weapon != inv.end())
|
if (shield != inv.end() && shield->getTypeName() == typeid(ESM::Armor).name() && !getShieldMesh(*shield).empty())
|
||||||
{
|
{
|
||||||
const std::string &type = weapon->getTypeName();
|
if(stats.getDrawState() != MWMechanics::DrawState_Weapon)
|
||||||
if(type == typeid(ESM::Weapon).name())
|
return false;
|
||||||
|
|
||||||
|
if (weapon != inv.end())
|
||||||
{
|
{
|
||||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref = weapon->get<ESM::Weapon>();
|
const std::string &type = weapon->getTypeName();
|
||||||
ESM::Weapon::Type weaponType = (ESM::Weapon::Type)ref->mBase->mData.mType;
|
if(type == typeid(ESM::Weapon).name())
|
||||||
return !(MWMechanics::getWeaponType(weaponType)->mFlags & ESM::WeaponType::TwoHanded);
|
{
|
||||||
|
const MWWorld::LiveCellRef<ESM::Weapon> *ref = weapon->get<ESM::Weapon>();
|
||||||
|
ESM::Weapon::Type weaponType = (ESM::Weapon::Type)ref->mBase->mData.mType;
|
||||||
|
return !(MWMechanics::getWeaponType(weaponType)->mFlags & ESM::WeaponType::TwoHanded);
|
||||||
|
}
|
||||||
|
else if (type == typeid(ESM::Lockpick).name() || type == typeid(ESM::Probe).name())
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else if (type == typeid(ESM::Lockpick).name() || type == typeid(ESM::Probe).name())
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue