diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Level3.cpp | 2 | ||||
-rw-r--r-- | src/game/Spell.cpp | 8 | ||||
-rw-r--r-- | src/game/Unit.cpp | 6 | ||||
-rw-r--r-- | src/game/Unit.h | 6 | ||||
-rw-r--r-- | src/shared/revision_nr.h | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index aef91bf1e9c..0b414cd64c7 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -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 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 30978ac6d99..3019b67b853 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 694003fbc97..766115742da 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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; } diff --git a/src/game/Unit.h b/src/game/Unit.h index b015f166a8b..98a49e519ac 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -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]; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index db510b27791..4755816010e 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 "7012" + #define REVISION_NR "7013" #endif // __REVISION_NR_H__ |