Skip to content

Commit

Permalink
[9530] Fixed check for SPELL_AURA_ALLOW_ONLY_ABILITY
Browse files Browse the repository at this point in the history
Also remove public access to SpellAura::m_spellmod for avoid another hacks
with it use. Spellmods only for Player::ApplySpellMod use.
  • Loading branch information
VladimirMangos committed Mar 6, 2010
1 parent 004df94 commit 08e06fd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
10 changes: 1 addition & 9 deletions src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5141,7 +5141,7 @@ SpellCastResult Spell::CheckCasterAuras() const
Unit::AuraList const& casingLimit = m_caster->GetAurasByType(SPELL_AURA_ALLOW_ONLY_ABILITY);
for(Unit::AuraList::const_iterator itr = casingLimit.begin(); itr != casingLimit.end(); ++itr)
{
if(!IsAffectedByAura(*itr))
if(!(*itr)->isAffectedOnSpell(m_spellInfo))
{
prevented_reason = SPELL_FAILED_CASTER_AURASTATE;
break;
Expand Down Expand Up @@ -5953,14 +5953,6 @@ void Spell::UpdatePointers()
m_targets.Update(m_caster);
}

bool Spell::IsAffectedByAura(Aura *aura) const
{
if(SpellModifier* mod = aura->getAuraSpellMod())
return mod->isAffectedOnSpell(m_spellInfo);
else
return false;
}

bool Spell::CheckTargetCreatureType(Unit* target) const
{
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
Expand Down
2 changes: 0 additions & 2 deletions src/game/Spell.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ class Spell

void UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)

bool IsAffectedByAura(Aura *aura) const;

bool CheckTargetCreatureType(Unit* target) const;

void AddTriggeredSpell(SpellEntry const* spellInfo) { m_TriggerSpells.push_back(spellInfo); }
Expand Down
2 changes: 0 additions & 2 deletions src/game/SpellAuras.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ class MANGOS_DLL_SPEC Aura
uint32 GetAuraTicks() const { return m_periodicTick; }
uint32 GetAuraMaxTicks() const { return m_maxduration > 0 && m_modifier.periodictime > 0 ? m_maxduration / m_modifier.periodictime : 0; }

SpellModifier *getAuraSpellMod() {return m_spellmod; }

uint64 const& GetCasterGUID() const { return m_caster_guid; }
Unit* GetCaster() const;
Unit* GetTarget() const { return m_target; }
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 "9529"
#define REVISION_NR "9530"
#endif // __REVISION_NR_H__

0 comments on commit 08e06fd

Please sign in to comment.