Core/Spells: combo points requirement should be changed before CheckCast

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-09-14 13:28:25 +03:00
parent 5e7bec0268
commit cdd8f446fa

View File

@@ -2981,6 +2981,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
// Set combo point requirement
if (m_IsTriggeredSpell || m_CastItem || !m_caster->m_movedPlayer)
m_needComboPoints = false;
SpellCastResult result = CheckCast(true);
if (result != SPELL_CAST_OK && !IsAutoRepeat()) //always cast autorepeat dummy for triggering
{
@@ -2998,10 +3002,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere
// Prepare data for triggers
prepareDataForTriggerSystem(triggeredByAura);
// Set combo point requirement
if (m_IsTriggeredSpell || m_CastItem || !m_caster->m_movedPlayer)
m_needComboPoints = false;
// calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail)
m_casttime = GetSpellCastTime(m_spellInfo, this);
//m_caster->ModSpellCastTime(m_spellInfo, m_casttime, this);
@@ -5744,7 +5744,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
// check if caster has at least 1 combo point for spells that require combo points
if (m_needComboPoints && !m_IsTriggeredSpell)
if (m_needComboPoints)
if (Player* plrCaster = m_caster->ToPlayer())
if (!plrCaster->GetComboPoints())
return SPELL_FAILED_NO_COMBO_POINTS;