mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Reset existing summons when the spell is re-casted (Fixes #2135)
This commit is contained in:
parent
f267497c03
commit
992b87ea44
1 changed files with 14 additions and 0 deletions
|
@ -471,6 +471,20 @@ namespace MWMechanics
|
||||||
else
|
else
|
||||||
applyInstantEffect(target, caster, EffectKey(*effectIt), magnitude);
|
applyInstantEffect(target, caster, EffectKey(*effectIt), magnitude);
|
||||||
|
|
||||||
|
// Re-casting a summon effect will remove the creature from previous castings of that effect.
|
||||||
|
if (effectIt->mEffectID >= ESM::MagicEffect::SummonScamp
|
||||||
|
&& effectIt->mEffectID <= ESM::MagicEffect::SummonStormAtronach
|
||||||
|
&& !target.isEmpty() && target.getClass().isActor())
|
||||||
|
{
|
||||||
|
CreatureStats& targetStats = target.getClass().getCreatureStats(target);
|
||||||
|
std::map<CreatureStats::SummonKey, int>::iterator found = targetStats.getSummonedCreatureMap().find(std::make_pair(effectIt->mEffectID, mId));
|
||||||
|
if (found != targetStats.getSummonedCreatureMap().end())
|
||||||
|
{
|
||||||
|
cleanupSummonedCreature(targetStats, found->second);
|
||||||
|
targetStats.getSummonedCreatureMap().erase(found);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HACK: Damage attribute/skill actually has a duration, even though the actual effect is instant and permanent.
|
// HACK: Damage attribute/skill actually has a duration, even though the actual effect is instant and permanent.
|
||||||
// This was probably just done to have the effect visible in the magic menu for a while
|
// This was probably just done to have the effect visible in the magic menu for a while
|
||||||
// to notify the player they've been damaged?
|
// to notify the player they've been damaged?
|
||||||
|
|
Loading…
Reference in a new issue