From ec735529dab2db23ead2fe1f212d9ff52f67a11e Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Fri, 8 Oct 2021 17:32:41 +0200 Subject: [PATCH] Remove active effects from the player when transforming --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index e7ae900086..5245e09f36 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1787,10 +1787,15 @@ namespace MWMechanics // Update the GUI only when called on the player MWBase::WindowManager* windowManager = MWBase::Environment::get().getWindowManager(); + // Transforming removes all temporary effects + actor.getClass().getCreatureStats(actor).getActiveSpells().purge([] (const auto& params) + { + return params.getType() == ESM::ActiveSpells::Type_Consumable || params.getType() == ESM::ActiveSpells::Type_Temporary; + }, actor); + mActors.updateActor(actor, 0.f); + if (werewolf) { - // Remove CE enchantments before saving stats - mActors.updateActor(actor, 0.f); player->saveStats(); player->setWerewolfStats(); windowManager->forceHide(MWGui::GW_Inventory);