Merge branch 'scroll_indices' into 'master'

Properly transform item ID to enchantment ID

Closes #6959

See merge request OpenMW/openmw!2328
crashfix_debugdraw
psi29a 2 years ago
commit f1e95ad615

@ -570,7 +570,11 @@ namespace MWWorld
if (const ESM::Spell* spell = esmStore.get<ESM::Spell>().search(magicBoltState.mSpellId))
effects = &spell->mEffects;
else
effects = &esmStore.get<ESM::Enchantment>().find(magicBoltState.mSpellId)->mEffects;
{
MWWorld::ManualRef ref(esmStore, magicBoltState.mSpellId);
const MWWorld::Ptr& ptr = ref.getPtr();
effects = &esmStore.get<ESM::Enchantment>().find(ptr.getClass().getEnchantment(ptr))->mEffects;
}
cast.inflict(target, caster, *effects, ESM::RT_Target);
magicBoltState.mToDelete = true;

Loading…
Cancel
Save