*Mangos [7013] Rename recently added function for consistent with already existed. Use it for old cases. By VladimirMangos.
--HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -2802,7 +2802,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
|
||||
|
||||
+4
-4
@@ -3489,9 +3489,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
|
||||
@@ -3513,9 +3513,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)
|
||||
|
||||
+3
-3
@@ -4012,11 +4012,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;
|
||||
}
|
||||
|
||||
+4
-2
@@ -1012,7 +1012,10 @@ class TRINITY_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; }
|
||||
|
||||
@@ -1312,7 +1315,6 @@ class TRINITY_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]; }
|
||||
|
||||
Reference in New Issue
Block a user