1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 02:45:38 +00:00

Fix a crash that occurred when a carried light fails to be attached.

This commit is contained in:
scrawl 2017-03-04 21:05:12 +01:00
parent 2776727794
commit 42a04de37c

View file

@ -625,7 +625,8 @@ void NpcAnimation::updateParts()
const ESM::Light *light = part.get<ESM::Light>()->mBase;
addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft,
1, "meshes\\"+light->mModel);
addExtraLight(mObjectParts[ESM::PRT_Shield]->getNode()->asGroup(), light);
if (mObjectParts[ESM::PRT_Shield])
addExtraLight(mObjectParts[ESM::PRT_Shield]->getNode()->asGroup(), light);
}
}
@ -920,7 +921,7 @@ void NpcAnimation::showCarriedLeft(bool show)
if (addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1,
mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor))
{
if (iter->getTypeName() == typeid(ESM::Light).name())
if (iter->getTypeName() == typeid(ESM::Light).name() && mObjectParts[ESM::PRT_Shield])
addExtraLight(mObjectParts[ESM::PRT_Shield]->getNode()->asGroup(), iter->get<ESM::Light>()->mBase);
}
}