* Fix some freezes.

* Fix freeze in HandleModMechanicImmunity- thanks for megamage for pointing this.

--HG--
branch : trunk
This commit is contained in:
QAston committed 2009-04-07 20:09:15 +02:00
1 parent 69657cad7c
commit 5e565cd777
6 files changed
+9301 -9294

No files matched your search

+7 -10
View File
@@ -2059,8 +2059,7 @@ void Spell::EffectTriggerSpell(uint32 i)
// ignore positive and passive auras
&& !iter->second->IsPositive() && !iter->second->IsPassive())
{
m_caster->RemoveAurasDueToSpell(spell->Id);
iter = Auras.begin();
m_caster->RemoveAura(iter->second);
}
}
return;
@@ -4533,23 +4532,21 @@ void Spell::EffectScriptEffect(uint32 effIndex)
// Removes snares and roots.
uint32 mechanic_mask = (1<<MECHANIC_ROOT) | (1<<MECHANIC_SNARE);
Unit::AuraMap& Auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end();)
{
next = iter;
++next;
Aura *aur = iter->second;
if (!aur->IsPositive()) //only remove negative spells
{
// check for mechanic mask
if(GetAllSpellMechanicMask(aur->GetSpellProto()) & mechanic_mask)
{
unitTarget->RemoveAurasDueToSpell(aur->GetId());
if(Auras.empty())
break;
else
next = Auras.begin();
unitTarget->RemoveAura(iter);
}
else
iter++;
}
else
iter++;
}
break;
}