Make sure we apply OT_Murder only once

pull/464/head
Andrei Kortunov 7 years ago
parent b7c159e5b6
commit 6d5d0039ec

@ -766,6 +766,8 @@ namespace MWMechanics
for (ActiveSpells::TIterator it = spells.begin(); it != spells.end(); ++it) for (ActiveSpells::TIterator it = spells.begin(); it != spells.end(); ++it)
{ {
bool actorKilled = false;
const ActiveSpells::ActiveSpellParams& spell = it->second; const ActiveSpells::ActiveSpellParams& spell = it->second;
MWWorld::Ptr caster = MWBase::Environment::get().getWorld()->searchPtrViaActorId(spell.mCasterActorId); MWWorld::Ptr caster = MWBase::Environment::get().getWorld()->searchPtrViaActorId(spell.mCasterActorId);
for (std::vector<ActiveSpells::ActiveEffect>::const_iterator effectIt = spell.mEffects.begin(); for (std::vector<ActiveSpells::ActiveEffect>::const_iterator effectIt = spell.mEffects.begin();
@ -793,10 +795,14 @@ namespace MWMechanics
caster.getClass().getNpcStats(caster).addWerewolfKill(); caster.getClass().getNpcStats(caster).addWerewolfKill();
MWBase::Environment::get().getMechanicsManager()->actorKilled(ptr, player); MWBase::Environment::get().getMechanicsManager()->actorKilled(ptr, player);
actorKilled = true;
break; break;
} }
} }
} }
if (actorKilled)
break;
} }
} }

Loading…
Cancel
Save