From fcbd3b4324717126133e556a5b38e2cb79de0cb4 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 11 Feb 2020 11:58:02 +0300 Subject: [PATCH] Don't try to attach absent shield models to NPCs --- apps/openmw/mwrender/npcanimation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 9633e9e1b..4dea64f79 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -1011,9 +1011,11 @@ void NpcAnimation::showCarriedLeft(bool show) if (!bodyparts.empty()) mesh = getShieldBodypartMesh(bodyparts, !mNpc->isMale()); } - if (addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1, - mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor)) + if (mesh.empty() || addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1, + mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor)) { + if (mesh.empty()) + reserveIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1); if (iter->getTypeName() == typeid(ESM::Light).name() && mObjectParts[ESM::PRT_Shield]) addExtraLight(mObjectParts[ESM::PRT_Shield]->getNode()->asGroup(), iter->get()->mBase); }