1
0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-12 08:31:25 +00:00

Allow enchantments to be missing on equipped items

This commit is contained in:
Alexei Kotov 2025-04-05 00:27:43 +03:00
parent 3523ba564a
commit 065a388632

@ -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) {