Only check for spelllist/equipment changes in the update loop

This commit is contained in:
Evil Eye 2025-07-13 11:18:15 +02:00
parent 2dbe30ed5c
commit c80b3d26b9

View File

@ -79,6 +79,7 @@ namespace MWMechanics
bool mUpdatedHitOverlay = false;
bool mUpdateSpellWindow = false;
bool mPlayNonLooping = false;
bool mEraseRemoved = false;
bool mUpdate;
UpdateContext(bool update)
@ -327,6 +328,7 @@ namespace MWMechanics
const MWWorld::Ptr player = MWMechanics::getPlayer();
// Update effects
context.mEraseRemoved = true;
for (auto spellIt = mSpells.begin(); spellIt != mSpells.end();)
{
updateActiveSpell(ptr, duration, spellIt, context);
@ -411,6 +413,8 @@ namespace MWMechanics
if (removedSpell)
return true;
if (context.mEraseRemoved)
{
bool remove = false;
if (spellIt->hasFlag(ESM::ActiveSpells::Flag_SpellStore))
{
@ -451,6 +455,7 @@ namespace MWMechanics
context.mUpdateSpellWindow = true;
return true;
}
}
++spellIt;
return false;
}