Core/Spells: fixed Inquisition not consuming all Holy Power caused by an logic mistake in HandleHolyPower that was not thinking about spells that do not have a target

This commit is contained in:
Ovahlord committed 2018-07-27 11:45:38 +02:00
1 parent f8fa109491
commit ed099e8600
1 file changed
+7 -7
+7 -7
View File
@@ -5003,7 +5003,7 @@ void Spell::HandleHolyPower(Player* caster)
if (!m_powerCost || !modOwner)
return;
if (uint64 targetGUID = m_targets.GetUnitTargetGUID())
if (ObjectGuid targetGUID = m_targets.GetUnitTargetGUID())
{
for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
{
@@ -5015,13 +5015,13 @@ void Spell::HandleHolyPower(Player* caster)
break;
}
}
}
// The spell did hit the target, apply aura cost mods if there are any.
if (hit)
{
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, m_powerCost, this);
m_caster->ModifyPower(POWER_HOLY_POWER, -m_powerCost);
}
// The spell did hit the target, apply aura cost mods if there are any.
if (hit)
{
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, m_powerCost, this);
m_caster->ModifyPower(POWER_HOLY_POWER, -m_powerCost);
}
}