[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
This commit is contained in:
VladimirMangos 2010-02-28 08:40:00 +03:00
parent 9a51a65b47
commit e05f4b1b03
2 changed files with 13 additions and 15 deletions

View file

@ -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()

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9477"
#define REVISION_NR "9478"
#endif // __REVISION_NR_H__