[7013] Rename recently added function for consistent with already existed. Use it for old cases.

This commit is contained in:
VladimirMangos 2009-01-03 14:24:26 +03:00
parent ba5e3dabc6
commit 7e5c17b6c3
5 changed files with 13 additions and 11 deletions

View file

@ -2718,7 +2718,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
bool talent = (talentCost > 0);
bool passive = IsPassiveSpell(id);
bool active = target && (target->HasAura(id,0) || target->HasAura(id,1) || target->HasAura(id,2));
bool active = target && target->HasAura(id);
// unit32 used to prevent interpreting uint8 as char at output
// find rank of learned spell for learning spell, or talent rank

View file

@ -3517,9 +3517,9 @@ uint8 Spell::CanCast(bool strict)
return SPELL_FAILED_CASTER_AURASTATE;
// Caster aura req check if need
if(m_spellInfo->casterAuraSpell && !m_caster->isAuraPresent(m_spellInfo->casterAuraSpell))
if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
return SPELL_FAILED_CASTER_AURASTATE;
if(m_spellInfo->excludeCasterAuraSpell && m_caster->isAuraPresent(m_spellInfo->excludeCasterAuraSpell))
if(m_spellInfo->excludeCasterAuraSpell && m_caster->HasAura(m_spellInfo->excludeCasterAuraSpell))
return SPELL_FAILED_CASTER_AURASTATE;
// cancel autorepeat spells if cast start when moving
@ -3541,9 +3541,9 @@ uint8 Spell::CanCast(bool strict)
return SPELL_FAILED_TARGET_AURASTATE;
// Target aura req check if need
if(m_spellInfo->targetAuraSpell && !target->isAuraPresent(m_spellInfo->targetAuraSpell))
if(m_spellInfo->targetAuraSpell && !target->HasAura(m_spellInfo->targetAuraSpell))
return SPELL_FAILED_CASTER_AURASTATE;
if(m_spellInfo->excludeTargetAuraSpell && target->isAuraPresent(m_spellInfo->excludeTargetAuraSpell))
if(m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell))
return SPELL_FAILED_CASTER_AURASTATE;
if(target != m_caster)

View file

@ -3803,11 +3803,11 @@ Aura* Unit::GetAura(uint32 spellId, uint32 effindex)
return NULL;
}
bool Unit::isAuraPresent(uint32 spellId)
bool Unit::HasAura(uint32 spellId) const
{
for (int i=0; i<3; ++i)
for (int i = 0; i < 3 ; ++i)
{
AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, i));
AuraMap::const_iterator iter = m_Auras.find(spellEffectPair(spellId, i));
if (iter != m_Auras.end())
return true;
}

View file

@ -985,7 +985,10 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
bool HasAuraType(AuraType auraType) const;
bool HasAura(uint32 spellId, uint32 effIndex) const
{ return m_Auras.find(spellEffectPair(spellId, effIndex)) != m_Auras.end(); }
{
return m_Auras.find(spellEffectPair(spellId, effIndex)) != m_Auras.end();
}
bool HasAura(uint32 spellId) const;
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
@ -1247,7 +1250,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
uint8 GetVisibleAurasCount() { return m_visibleAuras.size(); }
Aura* GetAura(uint32 spellId, uint32 effindex);
bool isAuraPresent(uint32 spellId);
AuraMap & GetAuras() { return m_Auras; }
AuraMap const& GetAuras() const { return m_Auras; }
AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7012"
#define REVISION_NR "7013"
#endif // __REVISION_NR_H__