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:
parent
2776727794
commit
42a04de37c
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue