mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 03:40:40 +00:00
Merge branch 'consistently_hostile' into 'master'
Clear the magic queue when unloading actors Closes #6954 See merge request OpenMW/openmw!2317
This commit is contained in:
commit
7c899364af
@ -498,4 +498,13 @@ namespace MWMechanics
|
||||
for(const ESM::ActiveSpells::ActiveSpellParams& spell : state.mQueue)
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -144,6 +144,8 @@ namespace MWMechanics
|
||||
///< case insensitive
|
||||
|
||||
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)
|
||||
{
|
||||
ptr.getClass().getCreatureStats(ptr).getActiveSpells().purge([] (const auto& spell)
|
||||
{
|
||||
return spell.getType() == ESM::ActiveSpells::Type_Consumable || spell.getType() == ESM::ActiveSpells::Type_Temporary;
|
||||
}, ptr);
|
||||
ptr.getClass().getCreatureStats(ptr).getActiveSpells().unloadActor(ptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -973,7 +973,7 @@ namespace MWWorld
|
||||
mPhysics->clearQueuedMovement();
|
||||
mDiscardMovements = true;
|
||||
|
||||
if (changeEvent && mCurrentWorldSpace != cellName)
|
||||
if (changeEvent && !Misc::StringUtils::ciEqual(mCurrentWorldSpace, cellName))
|
||||
{
|
||||
// changed worldspace
|
||||
mProjectileManager->clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user