From e05f4b1b0302c8a27b26d8036786ad41a9345a2e Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 28 Feb 2010 08:40:00 +0300 Subject: [PATCH] [9478] Reimplement Aura::IsNeedVisibleSlot Rewrite base at area aura type check * For positive area aura types show at non-caster target or caster-totem or non-passive aura at caster * For negative area aura show at non-caster target * For other auars show at any target if non passive auras or totem-caster --- src/game/SpellAuras.cpp | 26 ++++++++++++-------------- src/shared/revision_nr.h | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8e1ef9efe..07d95e8fa 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -945,26 +945,24 @@ bool Aura::IsNeedVisibleSlot(Unit const* caster) const { bool totemAura = caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem(); - // passive auras (except totem auras) do not get placed in the slots - if (m_isPassive && !totemAura) - return false; - - // generic not caster case - if (m_target != caster) - return true; - - // special area auras case at caster + // special area auras cases switch(m_spellProto->Effect[GetEffIndex()]) { case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY: - return false; + return m_target != caster; + case SPELL_EFFECT_APPLY_AREA_AURA_PET: + case SPELL_EFFECT_APPLY_AREA_AURA_OWNER: + case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND: + case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: case SPELL_EFFECT_APPLY_AREA_AURA_RAID: - // not sure is totemAura need, just preserve old code results - return totemAura || m_modifier.m_auraname != SPELL_AURA_NONE; - default: break; + // passive auras (except totem auras) do not get placed in caster slot + return (m_target != caster || totemAura || !m_isPassive) && m_modifier.m_auraname != SPELL_AURA_NONE; + default: + break; } - return true; + // passive auras (except totem auras) do not get placed in the slots + return !m_isPassive || totemAura; } void Aura::_AddAura() diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 277c9d7b2..f1cc3b3d5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9477" + #define REVISION_NR "9478" #endif // __REVISION_NR_H__