aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-01 15:08:12 -0500
committermegamage <none@none>2008-11-01 15:08:12 -0500
commitd292b85d3849cf45028ee98220311af9b0ccafa0 (patch)
treec038dfd8aba50141a3fa5665250ddadde753add7 /src/game/Unit.cpp
parente2eb694c57885e49f37c328b899d802e1ff4ea90 (diff)
[svn] Fix teleport spells.
Fix cone spells. Use interrupt_aura_flag to remove stealth/invisible/feign death auras. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index a095083d4ae..b594f3c0767 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -454,6 +454,26 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType)
}
}
+void Unit::RemoveInterruptableAura(uint32 flag)
+{
+ AuraList::iterator iter, next;
+ for (iter = m_interruptableAuras.begin(); iter != m_interruptableAuras.end(); iter = next)
+ {
+ next = iter;
+ ++next;
+
+ //sLog.outDetail("auraflag:%u flag:%u = %u",(*iter)->GetSpellProto()->AuraInterruptFlags,flag,(*iter)->GetSpellProto()->AuraInterruptFlags & flag);
+ if(*iter && ((*iter)->GetSpellProto()->AuraInterruptFlags & flag) == flag)
+ {
+ RemoveAurasDueToSpell((*iter)->GetId());
+ if (!m_interruptableAuras.empty())
+ next = m_interruptableAuras.begin();
+ else
+ return;
+ }
+ }
+}
+
bool Unit::HasAuraType(AuraType auraType) const
{
return (!m_modAuras[auraType].empty());
@@ -474,14 +494,13 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
}
// remove affects from victim (including from 0 damage and DoTs)
- if(pVictim != this)
- pVictim->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
+ //if(pVictim != this)
+ // pVictim->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
// remove affects from attacker at any non-DoT damage (including 0 damage)
if( damagetype != DOT)
{
- RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
- RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
+ RemoveInterruptableAura(AURA_INTERRUPT_FLAG_STEALTH);
if(pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNNED))
pVictim->SetStandState(PLAYER_STATE_NONE);
@@ -3738,6 +3757,8 @@ bool Unit::AddAura(Aura *Aur)
if (Aur->GetModifier()->m_auraname < TOTAL_AURAS)
{
m_modAuras[Aur->GetModifier()->m_auraname].push_back(Aur);
+ if(Aur->GetSpellProto()->AuraInterruptFlags)
+ m_interruptableAuras.push_back(Aur);
}
Aur->ApplyModifier(true,true);
@@ -4110,6 +4131,8 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
if ((*i).second->GetModifier()->m_auraname < TOTAL_AURAS)
{
m_modAuras[(*i).second->GetModifier()->m_auraname].remove((*i).second);
+ if((*i).second->GetSpellProto()->AuraInterruptFlags)
+ m_interruptableAuras.remove((*i).second);
}
// remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order)