Skip to content

Commit

Permalink
Remove powerCost from triggered spells
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife authored and Cyberium committed Jul 31, 2016
1 parent 4d84297 commit 27a8304
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/CreatureAI.cpp
Expand Up @@ -52,7 +52,7 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry* pSpell,
return CAST_FAIL_STATE;

// Check for power (also done by Spell::CheckCast())
if (m_creature->GetPower((Powers)pSpell->powerType) < Spell::CalculatePowerCost(pSpell, m_creature))
if (!isTriggered && (m_creature->GetPower((Powers)pSpell->powerType) < Spell::CalculatePowerCost(pSpell, m_creature)))

This comment has been minimized.

Copy link
@boxa

boxa Aug 1, 2016

Contributor

an extra check. above is checked already:

if (!isTriggered)

This comment has been minimized.

Copy link
@cyberium

cyberium Aug 1, 2016

Member

Thank i missed that

return CAST_FAIL_POWER;

if (!pSpell->HasAttribute(SPELL_ATTR_EX2_IGNORE_LOS) && !m_creature->IsWithinLOSInMap(pTarget) && m_creature != pTarget)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Spell.cpp
Expand Up @@ -3011,7 +3011,7 @@ void Spell::SpellStart(SpellCastTargets const* targets, Aura* triggeredByAura)
m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1));

// Fill cost data
m_powerCost = CalculatePowerCost(m_spellInfo, m_caster, this, m_CastItem);
m_powerCost = m_IsTriggeredSpell ? 0 : CalculatePowerCost(m_spellInfo, m_caster, this, m_CastItem);

SpellCastResult result = PreCastCheck();
if (result != SPELL_CAST_OK)
Expand Down

0 comments on commit 27a8304

Please sign in to comment.