mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-26 13:09:41 +00:00
Merge branch 'consistently_hostile' into 'master'
Clear the magic queue when unloading actors Closes #6954 See merge request OpenMW/openmw!2317 (cherry picked from commit7c899364af
)afcbb3cb
Clear the magic queue when unloading actors443420ea
CI compare cells
This commit is contained in:
parent
d262ca2d30
commit
2795097907
4 changed files with 13 additions and 5 deletions
|
@ -497,4 +497,13 @@ namespace MWMechanics
|
||||||
for(const ESM::ActiveSpells::ActiveSpellParams& spell : state.mQueue)
|
for(const ESM::ActiveSpells::ActiveSpellParams& spell : state.mQueue)
|
||||||
mQueue.emplace_back(ActiveSpellParams{spell});
|
mQueue.emplace_back(ActiveSpellParams{spell});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActiveSpells::unloadActor(const MWWorld::Ptr& ptr)
|
||||||
|
{
|
||||||
|
purge([] (const auto& spell)
|
||||||
|
{
|
||||||
|
return spell.getType() == ESM::ActiveSpells::Type_Consumable || spell.getType() == ESM::ActiveSpells::Type_Temporary;
|
||||||
|
}, ptr);
|
||||||
|
mQueue.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,8 @@ namespace MWMechanics
|
||||||
///< case insensitive
|
///< case insensitive
|
||||||
|
|
||||||
void skipWorsenings(double hours);
|
void skipWorsenings(double hours);
|
||||||
|
|
||||||
|
void unloadActor(const MWWorld::Ptr& ptr);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,10 +220,7 @@ void soulTrap(const MWWorld::Ptr& creature)
|
||||||
|
|
||||||
void removeTemporaryEffects(const MWWorld::Ptr& ptr)
|
void removeTemporaryEffects(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
ptr.getClass().getCreatureStats(ptr).getActiveSpells().purge([] (const auto& spell)
|
ptr.getClass().getCreatureStats(ptr).getActiveSpells().unloadActor(ptr);
|
||||||
{
|
|
||||||
return spell.getType() == ESM::ActiveSpells::Type_Consumable || spell.getType() == ESM::ActiveSpells::Type_Temporary;
|
|
||||||
}, ptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -972,7 +972,7 @@ namespace MWWorld
|
||||||
mPhysics->clearQueuedMovement();
|
mPhysics->clearQueuedMovement();
|
||||||
mDiscardMovements = true;
|
mDiscardMovements = true;
|
||||||
|
|
||||||
if (changeEvent && mCurrentWorldSpace != cellName)
|
if (changeEvent && !Misc::StringUtils::ciEqual(mCurrentWorldSpace, cellName))
|
||||||
{
|
{
|
||||||
// changed worldspace
|
// changed worldspace
|
||||||
mProjectileManager->clear();
|
mProjectileManager->clear();
|
||||||
|
|
Loading…
Reference in a new issue