aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellMgr.cpp61
-rw-r--r--src/game/Unit.cpp11
2 files changed, 29 insertions, 43 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 64415e2c4ed..6a7b5b2e2af 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1348,37 +1348,9 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
||(IsSingleFromSpellSpecificPerCaster(spellId_spec_1, spellId_spec_2) && sameCaster))
return true;
- // spells with different specific always stack
- if(spellId_spec_1 || spellId_spec_2)
- return false;
-
if(spellInfo_1->SpellFamilyName != spellInfo_2->SpellFamilyName)
return false;
- // TODO: Is this needed?
- // Allow stack passive and not passive spells
- if ((spellInfo_1->Attributes & SPELL_ATTR_PASSIVE)!=(spellInfo_2->Attributes & SPELL_ATTR_PASSIVE))
- return false;
-
- // generic spells
- if(!spellInfo_1->SpellFamilyName)
- {
- // hack for Incanter's Absorption
- if (spellInfo_1->Id==44413 && spellInfo_2->Id==44413)
- return false;
- if(!spellInfo_1->SpellIconID
- || spellInfo_1->SpellIconID == 1
- || spellInfo_1->SpellIconID != spellInfo_2->SpellIconID)
- return false;
- }
-
- // check for class spells
- else
- {
- if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)
- return false;
- }
-
if(!sameCaster)
{
for(uint32 i = 0; i < 3; ++i)
@@ -1403,17 +1375,34 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
}
}
-// not needed now because we compare effects last rank of spells
-// if(spellInfo_1->SpellFamilyName && IsRankSpellDueToSpell(spellInfo_1, spellId_2))
-// return true;
-
- //use data of highest rank spell(needed for spells which ranks have different effects)
- spellInfo_1=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_1));
- spellInfo_2=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_2));
+ // hack for Incanter's Absorption
+ if (spellInfo_1->Id==44413 && spellInfo_2->Id==44413)
+ return false;
- if (spellInfo_1==spellInfo_2)
+ spellId_2 = GetLastSpellInChain(spellId_2);
+ spellId_1 = GetLastSpellInChain(spellId_1);
+ if (spellId_1 == spellId_2)
return true;
+ // generic spells
+ if(!spellInfo_1->SpellFamilyName)
+ {
+ if(!spellInfo_1->SpellIconID
+ || spellInfo_1->SpellIconID == 1
+ || spellInfo_1->SpellIconID != spellInfo_2->SpellIconID)
+ return false;
+ }
+ // check for class spells
+ else
+ {
+ if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)
+ return false;
+ }
+
+ //use data of highest rank spell(needed for spells which ranks have different effects)
+ spellInfo_1=sSpellStore.LookupEntry(spellId_1);
+ spellInfo_2=sSpellStore.LookupEntry(spellId_2);
+
//if spells have exactly the same effect they cannot stack
for(uint32 i = 0; i < 3; ++i)
if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i]
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8451bd0f270..15ffdf494b2 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3729,13 +3729,10 @@ bool Unit::AddAura(Aura *Aur)
}
// passive auras not stacable with other ranks
- if (!IsPassiveSpellStackableWithRanks(aurSpellInfo))
+ if (!RemoveNoStackAurasDueToAura(Aur))
{
- if (!RemoveNoStackAurasDueToAura(Aur))
- {
- delete Aur;
- return false; // couldn't remove conflicting aura with higher rank
- }
+ delete Aur;
+ return false; // couldn't remove conflicting aura with higher rank
}
// update single target auras list (before aura add to aura list, to prevent unexpected remove recently added aura)
@@ -3890,7 +3887,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
// Remove all auras by aura caster
RemoveAurasDueToSpell(i_spellId , (*i).second->GetCasterGUID(), AURA_REMOVE_BY_STACK);
- if( m_Auras.empty() )
+ if( m_Auras.empty())
break;
else
next = m_Auras.begin();