|
|
|
@ -228,6 +228,7 @@ namespace MWMechanics
|
|
|
|
|
mSpells.emplace_back(ActiveSpellParams{ spell, ptr });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool updateSpellWindow = false;
|
|
|
|
|
if (ptr.getClass().hasInventoryStore(ptr)
|
|
|
|
|
&& !(creatureStats.isDead() && !creatureStats.isDeathAnimationFinished()))
|
|
|
|
|
{
|
|
|
|
@ -264,6 +265,7 @@ namespace MWMechanics
|
|
|
|
|
for (const auto& effect : params.mEffects)
|
|
|
|
|
MWMechanics::playEffects(
|
|
|
|
|
ptr, *world->getStore().get<ESM::MagicEffect>().find(effect.mEffectId), playNonLooping);
|
|
|
|
|
updateSpellWindow = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -365,6 +367,7 @@ namespace MWMechanics
|
|
|
|
|
for (const auto& effect : params.mEffects)
|
|
|
|
|
onMagicEffectRemoved(ptr, params, effect);
|
|
|
|
|
applyPurges(ptr, &spellIt);
|
|
|
|
|
updateSpellWindow = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
++spellIt;
|
|
|
|
@ -377,6 +380,14 @@ namespace MWMechanics
|
|
|
|
|
if (creatureStats.getMagicEffects().getOrDefault(effect).getMagnitude() > 0.f)
|
|
|
|
|
creatureStats.getAiSequence().stopCombat();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ptr == player && updateSpellWindow)
|
|
|
|
|
{
|
|
|
|
|
// Something happened with the spell list -- possibly while the game is paused,
|
|
|
|
|
// so we want to make the spell window get the memo.
|
|
|
|
|
// We don't normally want to do this, so this targets constant enchantments.
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->updateSpellWindow();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ActiveSpells::addToSpells(const MWWorld::Ptr& ptr, const ActiveSpellParams& spell)
|
|
|
|
|