From 04ebe5c4c9648c570574e193ed800d5460fdf9d3 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Thu, 26 Mar 2020 15:22:31 +0300 Subject: [PATCH] Reset skills of dead actors (bug #5328) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/actors.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85fffdd1f6..0101587fab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -207,6 +207,7 @@ Bug #5300: NPCs don't switch from torch to shield when starting combat Bug #5308: World map copying makes save loading much slower Bug #5313: Node properties of identical type are not applied in the correct order + Bug #5328: Skills aren't properly reset for dead actors Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index bda78c0b57..29ed1a7679 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1850,6 +1850,8 @@ namespace MWMechanics stats.getActiveSpells().visitEffectSources(soulTrap); } + // Magic effects will be reset later, and the magic effect that could kill the actor + // needs to be determined now calculateCreatureStatModifiers(iter->first, 0); if (cls.isEssential(iter->first)) @@ -1867,7 +1869,9 @@ namespace MWMechanics // Make sure spell effects are removed purgeSpellEffects(stats.getActorId()); + // Reset dynamic stats, attributes and skills calculateCreatureStatModifiers(iter->first, 0); + calculateNpcStatModifiers(iter->first, 0); if( iter->first == getPlayer()) {