Merge branch 'enchantment404' into 'master'

Allow referenced enchantments to be missing on equipped items

See merge request OpenMW/openmw!4617
This commit is contained in:
psi29a 2025-04-06 16:06:10 +00:00
commit b29d89bd6a

View file

@ -289,8 +289,9 @@ namespace MWMechanics
const ESM::RefId& enchantmentId = slot->getClass().getEnchantment(*slot);
if (enchantmentId.empty())
continue;
const ESM::Enchantment* enchantment = world->getStore().get<ESM::Enchantment>().find(enchantmentId);
if (enchantment->mData.mType != ESM::Enchantment::ConstantEffect)
const ESM::Enchantment* enchantment
= world->getStore().get<ESM::Enchantment>().search(enchantmentId);
if (enchantment == nullptr || enchantment->mData.mType != ESM::Enchantment::ConstantEffect)
continue;
if (std::find_if(mSpells.begin(), mSpells.end(),
[&](const ActiveSpellParams& params) {