From 2b9d475e50b1bbc564f8fea06f9173b73584caad Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 22 Aug 2022 17:44:49 +0200 Subject: [PATCH] Fix #6959 --- apps/openmw/mwworld/projectilemanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index a5c94e28c9..c19a609031 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -570,7 +570,11 @@ namespace MWWorld if (const ESM::Spell* spell = esmStore.get().search(magicBoltState.mSpellId)) effects = &spell->mEffects; else - effects = &esmStore.get().find(magicBoltState.mSpellId)->mEffects; + { + MWWorld::ManualRef ref(esmStore, magicBoltState.mSpellId); + const MWWorld::Ptr& ptr = ref.getPtr(); + effects = &esmStore.get().find(ptr.getClass().getEnchantment(ptr))->mEffects; + } cast.inflict(target, caster, *effects, ESM::RT_Target); magicBoltState.mToDelete = true;