[7597] Fixed crash at stealing single target auras (54648 for example)

This commit is contained in:
arrai 2009-04-01 23:10:03 +02:00
parent 4d42cd9e1a
commit 1ec8e1f24d
5 changed files with 46 additions and 27 deletions

View file

@ -360,6 +360,8 @@ m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false)
m_isPassive = IsPassiveSpell(GetId());
m_positive = IsPositiveEffect(GetId(), m_effIndex);
m_isSingleTargetAura = IsSingleTargetSpell(m_spellProto);
m_applyTime = time(NULL);
int32 damage;
@ -6742,3 +6744,21 @@ void Aura::HandlePhase(bool apply, bool Real)
m_target->SetVisibility(m_target->GetVisibility());
}
void Aura::UnregisterSingleCastAura()
{
if (IsSingleTarget())
{
Unit* caster = NULL;
caster = GetCaster();
if(caster)
{
caster->GetSingleCastAuras().remove(this);
}
else
{
sLog.outError("Couldn't find the caster of the single target aura, may crash later!");
assert(false);
}
m_isSingleTargetAura = false;
}
}