Show
Ignore:
Timestamp:
11/19/08 13:40:02 (17 years ago)
Author:
yumileroy
Message:

[svn] Fix teleport spells.
Fix cone spells.
Use interrupt_aura_flag to remove stealth/invisible/feign death auras.

Original author: megamage
Date: 2008-11-01 15:08:12-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Unit.cpp

    r141 r142  
    455455} 
    456456 
     457void Unit::RemoveInterruptableAura(uint32 flag) 
     458{ 
     459    AuraList::iterator iter, next; 
     460    for (iter = m_interruptableAuras.begin(); iter != m_interruptableAuras.end(); iter = next) 
     461    { 
     462        next = iter; 
     463        ++next; 
     464 
     465        //sLog.outDetail("auraflag:%u flag:%u = %u",(*iter)->GetSpellProto()->AuraInterruptFlags,flag,(*iter)->GetSpellProto()->AuraInterruptFlags & flag); 
     466        if(*iter && ((*iter)->GetSpellProto()->AuraInterruptFlags & flag) == flag) 
     467        { 
     468            RemoveAurasDueToSpell((*iter)->GetId()); 
     469            if (!m_interruptableAuras.empty()) 
     470                next = m_interruptableAuras.begin(); 
     471            else 
     472                return; 
     473        } 
     474    } 
     475} 
     476 
    457477bool Unit::HasAuraType(AuraType auraType) const 
    458478{ 
     
    475495 
    476496    // remove affects from victim (including from 0 damage and DoTs) 
    477     if(pVictim != this) 
    478         pVictim->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
     497    //if(pVictim != this) 
     498    //    pVictim->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
    479499 
    480500    // remove affects from attacker at any non-DoT damage (including 0 damage) 
    481501    if( damagetype != DOT) 
    482502    { 
    483         RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
    484         RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); 
     503        RemoveInterruptableAura(AURA_INTERRUPT_FLAG_STEALTH); 
    485504 
    486505        if(pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNNED)) 
     
    37393758    { 
    37403759        m_modAuras[Aur->GetModifier()->m_auraname].push_back(Aur); 
     3760        if(Aur->GetSpellProto()->AuraInterruptFlags) 
     3761            m_interruptableAuras.push_back(Aur); 
    37413762    } 
    37423763 
     
    41114132    { 
    41124133        m_modAuras[(*i).second->GetModifier()->m_auraname].remove((*i).second); 
     4134        if((*i).second->GetSpellProto()->AuraInterruptFlags) 
     4135            m_interruptableAuras.remove((*i).second); 
    41134136    } 
    41144137