Core/Auras: Allow stacking of auras proced from different items
Closes issue #2296. --HG-- branch : trunk
This commit is contained in:
@@ -46,14 +46,14 @@ m_effectsToApply(effMask), m_removeMode(AURA_REMOVE_NONE), m_needClientUpdate(fa
|
||||
// Try find slot for aura
|
||||
uint8 slot = MAX_AURAS;
|
||||
// Lookup for auras already applied from spell
|
||||
if (AuraApplication * foundAura = m_target->GetAuraApplication(m_base->GetId(), m_base->GetCasterGUID()))
|
||||
if (AuraApplication * foundAura = GetTarget()->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
|
||||
{
|
||||
// allow use single slot only by auras from same caster
|
||||
slot = foundAura->GetSlot();
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit::VisibleAuraMap const * visibleAuras = m_target->GetVisibleAuras();
|
||||
Unit::VisibleAuraMap const * visibleAuras = GetTarget()->GetVisibleAuras();
|
||||
// lookup for free slots in units visibleAuras
|
||||
Unit::VisibleAuraMap::const_iterator itr = visibleAuras->find(0);
|
||||
for (uint32 freeSlot = 0; freeSlot < MAX_AURAS; ++itr , ++freeSlot)
|
||||
@@ -70,7 +70,7 @@ m_effectsToApply(effMask), m_removeMode(AURA_REMOVE_NONE), m_needClientUpdate(fa
|
||||
if (slot < MAX_AURAS)
|
||||
{
|
||||
m_slot = slot;
|
||||
m_target->SetVisibleAura(slot, this);
|
||||
GetTarget()->SetVisibleAura(slot, this);
|
||||
SetNeedClientUpdate();
|
||||
sLog.outDebug("Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot);
|
||||
}
|
||||
@@ -82,7 +82,7 @@ m_effectsToApply(effMask), m_removeMode(AURA_REMOVE_NONE), m_needClientUpdate(fa
|
||||
if (GetBase()->GetCasterGUID() == GetTarget()->GetGUID()) // caster == target - 1 negative effect is enough for aura to be negative
|
||||
m_isNeedManyNegativeEffects = false;
|
||||
else if (caster)
|
||||
m_isNeedManyNegativeEffects = caster->IsFriendlyTo(m_target);
|
||||
m_isNeedManyNegativeEffects = caster->IsFriendlyTo(GetTarget());
|
||||
|
||||
m_flags |= (_CheckPositive(caster) ? AFLAG_POSITIVE : AFLAG_NEGATIVE) |
|
||||
(GetBase()->GetCasterGUID() == GetTarget()->GetGUID() ? AFLAG_CASTER : AFLAG_NONE);
|
||||
@@ -95,7 +95,7 @@ void AuraApplication::_Remove()
|
||||
if (slot >= MAX_AURAS)
|
||||
return;
|
||||
|
||||
if (AuraApplication * foundAura = m_target->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID()))
|
||||
if (AuraApplication * foundAura = m_target->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
|
||||
{
|
||||
// Reuse visible aura slot by aura which is still applied - prevent storing dead pointers
|
||||
if (slot == foundAura->GetSlot())
|
||||
|
||||
Reference in New Issue
Block a user