aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-04-28 16:08:31 +0200
committerMachiavelli <none@none>2010-04-28 16:08:31 +0200
commitab013e42c92065abe99b4e02b812fc5bdd009cca (patch)
treead304550a3df27b36eba245404503be4799a5275 /src/game/SpellEffects.cpp
parent311d108529917d2f5b7f19a0072760b350f14660 (diff)
Fix action buttons sent to client when swapping between talent specs. Storage related parts by Hunuza (MaNGOS), big thanks.
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 927c2079135..c061606c4db 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -7602,24 +7602,26 @@ void Spell::EffectCastButtons(uint32 i)
for (; n_buttons; n_buttons--, button_id++)
{
- if (uint32 spell_id = p_caster->GetActionButtonSpell(button_id))
- {
- if (!spell_id)
- continue;
+ ActionButton const* ab = p_caster->GetActionButton(button_id);
+ if (!ab || ab->GetAction() != ACTION_BUTTON_SPELL)
+ continue;;
- if (p_caster->HasSpellCooldown(spell_id))
- continue;
+ uint32 spell_id = ab->GetAction();
+ if (!spell_id)
+ continue;
+
+ if (p_caster->HasSpellCooldown(spell_id))
+ continue;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
- uint32 cost = CalculatePowerCost(spellInfo, m_caster, GetSpellSchoolMask(spellInfo));
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
+ uint32 cost = CalculatePowerCost(spellInfo, m_caster, GetSpellSchoolMask(spellInfo));
- if (m_caster->GetPower(POWER_MANA) < cost)
- break;
+ if (m_caster->GetPower(POWER_MANA) < cost)
+ break;
m_caster->CastSpell(unitTarget, spell_id, true);
m_caster->ModifyPower(POWER_MANA, -(int32)cost);
p_caster->AddSpellAndCategoryCooldowns(spellInfo, 0);
- }
}
}