From 238d68b69123183f3f58afd496163e9025a45c47 Mon Sep 17 00:00:00 2001 From: trav5 Date: Mon, 13 May 2024 21:41:41 +0200 Subject: [PATCH] Magic effects are updated once before applying when resting Fixing #7970. When the player was resting, all their magic effects were applied throughout the rest duration, including the effects for already removed spells, which were applied once more before removal. This commit calls an update before that applying, so that these removed spells are executed and removed and only then the real duration-long execution of remaining magic effects takes place. --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/actors.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9ef163dc..0559e10f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -172,6 +172,7 @@ Bug #7901: Editor: Teleport-related fields shouldn't be editable if a ref does not teleport Bug #7908: Key bindings names in the settings menu are layout-specific Bug #7943: Using "addSoulGem" and "dropSoulGem" commands to creatures works only with "Weapon & Shield" flagged ones + Bug #7970: Difference of GetPCSleep (?) behavior between vanilla and OpenMW Feature #2566: Handle NAM9 records for manual cell references Feature #3537: Shader-based water ripples Feature #5173: Support for NiFogProperty diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 32f81c398e..1bebd3feb8 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1879,6 +1879,9 @@ namespace MWMechanics > actorsProcessingRange * actorsProcessingRange) continue; + // Get rid of effects pending removal so they are not applied when resting + updateMagicEffects(actor.getPtr()); + adjustMagicEffects(actor.getPtr(), duration); MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(actor.getPtr());