1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-03 17:54:06 +00:00

Remove CE enchantments before saving stats when turning into a werewolf

This commit is contained in:
Evil Eye 2021-10-07 21:09:43 +02:00
parent 1f62fd3b56
commit caafd0c667

View File

@ -1761,17 +1761,6 @@ namespace MWMechanics
MWWorld::Player* player = &MWBase::Environment::get().getWorld()->getPlayer();
if (actor == player->getPlayer())
{
if (werewolf)
{
player->saveStats();
player->setWerewolfStats();
}
else
player->restoreStats();
}
// Werewolfs can not cast spells, so we need to unset the prepared spell if there is one.
if (npcStats.getDrawState() == MWMechanics::DrawState_Spell)
npcStats.setDrawState(MWMechanics::DrawState_Nothing);
@ -1800,11 +1789,16 @@ namespace MWMechanics
if (werewolf)
{
// Remove CE enchantments before saving stats
mActors.updateActor(actor, 0.f);
player->saveStats();
player->setWerewolfStats();
windowManager->forceHide(MWGui::GW_Inventory);
windowManager->forceHide(MWGui::GW_Magic);
}
else
{
player->restoreStats();
windowManager->unsetForceHide(MWGui::GW_Inventory);
windowManager->unsetForceHide(MWGui::GW_Magic);
}