|
|
|
@ -110,6 +110,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, int v
|
|
|
|
|
mListenerDisabled(disableListener),
|
|
|
|
|
mViewMode(viewMode),
|
|
|
|
|
mShowWeapons(false),
|
|
|
|
|
mShowShield(true),
|
|
|
|
|
mFirstPersonOffset(0.f, 0.f, 0.f)
|
|
|
|
|
{
|
|
|
|
|
mNpc = mPtr.get<ESM::NPC>()->mBase;
|
|
|
|
@ -307,6 +308,7 @@ void NpcAnimation::updateParts()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showWeapons(mShowWeapons);
|
|
|
|
|
showShield(mShowShield);
|
|
|
|
|
|
|
|
|
|
// Remember body parts so we only have to search through the store once for each race/gender/viewmode combination
|
|
|
|
|
static std::map< std::pair<std::string,int>,std::vector<const ESM::BodyPart*> > sRaceMapping;
|
|
|
|
@ -635,6 +637,34 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NpcAnimation::showShield(bool show)
|
|
|
|
|
{
|
|
|
|
|
mShowShield = show;
|
|
|
|
|
MWWorld::InventoryStore &inv = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
|
|
|
|
MWWorld::ContainerStoreIterator shield = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
|
|
|
|
|
|
|
|
|
if (shield != inv.end() && shield->getTypeName() == typeid(ESM::Light).name())
|
|
|
|
|
{
|
|
|
|
|
// ... Except for lights, which are still shown during spellcasting since they
|
|
|
|
|
// have their own (one-handed) casting animations
|
|
|
|
|
show = true;
|
|
|
|
|
}
|
|
|
|
|
if(show && shield != inv.end())
|
|
|
|
|
{
|
|
|
|
|
Ogre::Vector3 glowColor = getEnchantmentColor(*shield);
|
|
|
|
|
std::string mesh = MWWorld::Class::get(*shield).getModel(*shield);
|
|
|
|
|
addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1,
|
|
|
|
|
mesh, !shield->getClass().getEnchantment(*shield).empty(), &glowColor);
|
|
|
|
|
|
|
|
|
|
if (shield->getTypeName() == typeid(ESM::Light).name())
|
|
|
|
|
addExtraLight(mInsert->getCreator(), mObjectParts[ESM::PRT_Shield], shield->get<ESM::Light>()->mBase);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
removeIndividualPart(ESM::PRT_Shield);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NpcAnimation::permanentEffectAdded(const ESM::MagicEffect *magicEffect, bool isNew, bool playSound)
|
|
|
|
|
{
|
|
|
|
|
// During first auto equip, we don't play any sounds.
|
|
|
|
|