Skip to content

Commit

Permalink
Prevent (in some cases) remove aura state flag if exist similar aura.
Browse files Browse the repository at this point in the history
Signed-off-by: DiSlord <dislord@nomail.com>

(based on commit bd60bd1)

Re-apply master commit, because old time it has been not fully applied

Thanks to mns for find exactly porblem and suggest fix.
  • Loading branch information
DiSlord authored and VladimirMangos committed Jul 8, 2010
1 parent e179f6e commit 2177a4d
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ void Aura::_AddAura()
if (!secondaura)
{
// Update Seals information
if( IsSealSpell(GetSpellProto()) )
if (IsSealSpell(GetSpellProto()))
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);

// Conflagrate aura state
Expand Down Expand Up @@ -1055,12 +1055,18 @@ bool Aura::_RemoveAura()
removeState = AURA_STATE_CONFLAGRATE; // Conflagrate aura state
break;
case SPELLFAMILY_DRUID:
if(m_spellProto->SpellFamilyFlags & 0x50)
if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400))
removeState = AURA_STATE_FAERIE_FIRE; // Faerie Fire (druid versions)
else if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000050))
{
removeFamilyFlag = 0x50;
removeFamilyFlag = UI64LIT(0x0000000000000050);
removeState = AURA_STATE_SWIFTMEND; // Swiftmend aura state
}
break;
case SPELLFAMILY_ROGUE:
if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000010000))
removeState = AURA_STATE_DEADLY_POISON; // Deadly poison aura state
break;
}

// Remove state (but need check other auras for it)
Expand All @@ -1084,26 +1090,6 @@ bool Aura::_RemoveAura()
m_target->ModifyAuraState(AuraState(removeState), false);
}

// Deadly poison aura state
if(m_spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellProto->SpellFamilyFlags & 0x10000)
{
// current aura already removed, search present of another
bool found = false;
Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* itr_spell = (*itr)->GetSpellProto();
if(itr_spell && itr_spell->SpellFamilyName==SPELLFAMILY_ROGUE && itr_spell->SpellFamilyFlags & 0x10000)
{
found = true;
break;
}
}
// this has been last deadly poison aura
if(!found)
m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON,false);
}

// reset cooldown state for spells
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
{
Expand Down

0 comments on commit 2177a4d

Please sign in to comment.