1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-25 21:39:42 +00:00

Merge branch 'scroll_indices' into 'master'

Properly transform item ID to enchantment ID

Closes #6959

See merge request OpenMW/openmw!2328

(cherry picked from commit f1e95ad615)

2b9d475e Fix #6959
This commit is contained in:
psi29a 2022-08-22 17:18:15 +00:00
parent ada64daf87
commit 649ca6b8e6

View file

@ -569,7 +569,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;