Skip to content

Commit b29d89b

Browse files
committed
Merge branch 'enchantment404' into 'master'
Allow referenced enchantments to be missing on equipped items See merge request OpenMW/openmw!4617
2 parents 211a5e5 + 065a388 commit b29d89b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/openmw/mwmechanics/activespells.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,9 @@ namespace MWMechanics
289289
const ESM::RefId& enchantmentId = slot->getClass().getEnchantment(*slot);
290290
if (enchantmentId.empty())
291291
continue;
292-
const ESM::Enchantment* enchantment = world->getStore().get<ESM::Enchantment>().find(enchantmentId);
293-
if (enchantment->mData.mType != ESM::Enchantment::ConstantEffect)
292+
const ESM::Enchantment* enchantment
293+
= world->getStore().get<ESM::Enchantment>().search(enchantmentId);
294+
if (enchantment == nullptr || enchantment->mData.mType != ESM::Enchantment::ConstantEffect)
294295
continue;
295296
if (std::find_if(mSpells.begin(), mSpells.end(),
296297
[&](const ActiveSpellParams& params) {

0 commit comments

Comments
 (0)