mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Remove active effects from the player when transforming
This commit is contained in:
parent
caafd0c667
commit
ec735529da
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user