From 49de215112be5d438e1ba59df97fcf904234305e Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 24 Aug 2025 19:03:53 +0200 Subject: [PATCH] Don't add magic effects to dead actors --- apps/openmw/mwmechanics/activespells.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwmechanics/activespells.cpp b/apps/openmw/mwmechanics/activespells.cpp index c19b494845..24e43e6d27 100644 --- a/apps/openmw/mwmechanics/activespells.cpp +++ b/apps/openmw/mwmechanics/activespells.cpp @@ -294,19 +294,22 @@ namespace MWMechanics addToSpells(ptr, spell, context); mQueue.clear(); - // Vanilla only does this on cell change I think - const auto& spells = creatureStats.getSpells(); - for (const ESM::Spell* spell : spells) + if (!creatureStats.isDead()) { - if (spell->mData.mType != ESM::Spell::ST_Spell && spell->mData.mType != ESM::Spell::ST_Power - && !isSpellActive(spell->mId)) + // Vanilla only does this on cell change I think + const auto& spells = creatureStats.getSpells(); + for (const ESM::Spell* spell : spells) { - initParams(ptr, ActiveSpellParams{ spell, ptr, true }, context); + if (spell->mData.mType != ESM::Spell::ST_Spell && spell->mData.mType != ESM::Spell::ST_Power + && !isSpellActive(spell->mId)) + { + initParams(ptr, ActiveSpellParams{ spell, ptr, true }, context); + } } } if (ptr.getClass().hasInventoryStore(ptr) - && !(creatureStats.isDead() && !creatureStats.isDeathAnimationFinished())) + && !(creatureStats.isDead() && creatureStats.isDeathAnimationFinished())) { auto& store = ptr.getClass().getInventoryStore(ptr); if (store.getInvListener() != nullptr)