1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-30 16:06:41 +00:00

Merge pull request #2560 from Capostrophic/geteffect

Fix GetEffect result when running on dead actors
This commit is contained in:
Andrei Kortunov 2019-10-26 12:47:58 +04:00 committed by GitHub
commit b27089f7be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -1826,6 +1826,7 @@ namespace MWMechanics
// One case where we need this is to make sure bound items are removed upon death
stats.modifyMagicEffects(MWMechanics::MagicEffects());
stats.getActiveSpells().clear();
stats.getSpells().clear();
// Make sure spell effects are removed
purgeSpellEffects(stats.getActorId());

View file

@ -441,7 +441,7 @@ namespace MWScript
MWMechanics::MagicEffects effects = stats.getSpells().getMagicEffects();
effects += stats.getActiveSpells().getMagicEffects();
if (ptr.getClass().hasInventoryStore(ptr))
if (ptr.getClass().hasInventoryStore(ptr) && !stats.isDeathAnimationFinished())
{
MWWorld::InventoryStore& store = ptr.getClass().getInventoryStore(ptr);
effects += store.getMagicEffects();