Skip to content

Commit

Permalink
[9478] Reimplement Aura::IsNeedVisibleSlot
Browse files Browse the repository at this point in the history
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
  • Loading branch information
VladimirMangos committed Feb 28, 2010
1 parent 69810da commit 31a3816
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
26 changes: 12 additions & 14 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9477"
#define REVISION_NR "9478"
#endif // __REVISION_NR_H__

0 comments on commit 31a3816

Please sign in to comment.