From 9af492483e8be747cd097bf11a4e68c41f9f2d96 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 23 May 2009 10:57:05 +0200 Subject: *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 --- src/game/Unit.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/game/Unit.cpp') 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 -- cgit v1.2.3