Merge branch 'recall_how_to_recall' into 'master'

Prevent recursive calls to ActiveSpells::update

Closes #7022

See merge request OpenMW/openmw!2426
coverity_clang_test
psi29a 2 years ago
commit d38c072030

@ -184,6 +184,8 @@ namespace MWMechanics
void ActiveSpells::update(const MWWorld::Ptr& ptr, float duration) void ActiveSpells::update(const MWWorld::Ptr& ptr, float duration)
{ {
if (mIterating)
return;
const auto& creatureStats = ptr.getClass().getCreatureStats(ptr); const auto& creatureStats = ptr.getClass().getCreatureStats(ptr);
assert(&creatureStats.getActiveSpells() == this); assert(&creatureStats.getActiveSpells() == this);
IterationGuard guard{ *this }; IterationGuard guard{ *this };

Loading…
Cancel
Save