diff options
author | QAston <none@none> | 2009-05-23 10:57:05 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-05-23 10:57:05 +0200 |
commit | 9af492483e8be747cd097bf11a4e68c41f9f2d96 (patch) | |
tree | 2e1274e132380dcd0ae2b0ecf278cabba8377859 /src/game/Unit.cpp | |
parent | 028ed64e1091b9664babe132386a7530876f2ccf (diff) |
*always remove old aura instead of recalculating new one in same id stack case-this prevents some problem with spelleffects execution problems
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 47bb7307a2b..609aef6df02 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3809,22 +3809,18 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects) SpellEntry const* aurSpellInfo = Aur->GetSpellProto(); - // passive and persistent auras can stack with themselves any number of times - if (!Aur->IsPassive() && !Aur->IsPersistent()) + // passive and persistent and Incanter's Absorption auras can stack with themselves any number of times + if (!Aur->IsPassive() && !Aur->IsPersistent() && aurSpellInfo->Id != 44413) { // find current aura from spell and change it's stackamount if (Aura * foundAura = GetAura(aurSpellInfo->Id, Aur->GetCasterGUID())) { - // hack for Incanter's Absorption - if (aurSpellInfo->Id != 44413) - { - if(aurSpellInfo->StackAmount && foundAura->GetStackAmount() < aurSpellInfo->StackAmount) - foundAura->SetStackAmount(foundAura->GetStackAmount()+1); - else - foundAura->RefreshAura(); - delete Aur; - return false; - } + uint8 stackAmount = foundAura->GetStackAmount() + 1; + if (stackAmount > aurSpellInfo->StackAmount) + stackAmount = aurSpellInfo->StackAmount; + Aur->SetStackAmount(stackAmount); + RemoveAura(foundAura, AURA_REMOVE_BY_STACK); + return true; } } @@ -3915,10 +3911,6 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) uint32 i_spellId = i_spellProto->Id; bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID(); - // Incanter's Absorption, has been checked in refresh part - if(i_spellId == spellId && sameCaster) - continue; - if(IsPassiveSpell(i_spellId)) { // passive non-stackable spells not stackable only for same caster |