*Try to fix a crash caused by single target auras. Thanks to QAston.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-11 18:26:04 -05:00
parent 3078bf6fd0
commit 978242da3f
5 changed files with 28 additions and 21 deletions

View File

@@ -3924,8 +3924,7 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects)
for(;;)
{
Unit* caster = Aur->GetCaster();
if(!caster) // caster deleted and not required adding scAura
break;
assert(caster);
bool restart = false;
AuraList& scAuras = caster->GetSingleCastAuras();
@@ -4251,7 +4250,7 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase)
if (aura->GetTarget() != this && !aura->GetTarget()->InSamePhase(newPhase))
{
uint32 removedAuras = m_removedAurasCount;
aura->GetTarget()->RemoveAura(aura->GetId(),aura->GetCasterGUID());
aura->GetTarget()->RemoveAura(aura);
if (removedAuras+1<m_removedAurasCount)
iter=scAuras.begin();
}