mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 20:49:56 +00:00
When an actor dies purge all spell effects cast by that actor (Fixes #3175)
This commit is contained in:
parent
c403a6b113
commit
c34314ae26
2 changed files with 2 additions and 4 deletions
|
@ -274,9 +274,7 @@ namespace MWMechanics
|
||||||
for (std::vector<ActiveEffect>::iterator effectIt = it->second.mEffects.begin();
|
for (std::vector<ActiveEffect>::iterator effectIt = it->second.mEffects.begin();
|
||||||
effectIt != it->second.mEffects.end();)
|
effectIt != it->second.mEffects.end();)
|
||||||
{
|
{
|
||||||
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectIt->mEffectId);
|
if (it->second.mCasterActorId == casterActorId)
|
||||||
if (effect->mData.mFlags & ESM::MagicEffect::CasterLinked
|
|
||||||
&& it->second.mCasterActorId == casterActorId)
|
|
||||||
effectIt = it->second.mEffects.erase(effectIt);
|
effectIt = it->second.mEffects.erase(effectIt);
|
||||||
else
|
else
|
||||||
++effectIt;
|
++effectIt;
|
||||||
|
|
|
@ -1209,7 +1209,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
++mDeathCount[Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId())];
|
++mDeathCount[Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId())];
|
||||||
|
|
||||||
// Make sure spell effects with CasterLinked flag are removed
|
// Make sure spell effects are removed
|
||||||
for (PtrActorMap::iterator iter2(mActors.begin());iter2 != mActors.end();++iter2)
|
for (PtrActorMap::iterator iter2(mActors.begin());iter2 != mActors.end();++iter2)
|
||||||
{
|
{
|
||||||
MWMechanics::ActiveSpells& spells = iter2->first.getClass().getCreatureStats(iter2->first).getActiveSpells();
|
MWMechanics::ActiveSpells& spells = iter2->first.getClass().getCreatureStats(iter2->first).getActiveSpells();
|
||||||
|
|
Loading…
Reference in a new issue