*Remove combo points when spell casted. This fixes the bug that rogue can cast multiple deadly throw before dagger hits target. But this also makes deadly throw do not receive combo bonus. This bug can only be trully fixed by calculating spell damage when spell is casted but not when spell hits target.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-12 22:14:43 -06:00
parent f088698922
commit 032f5bc87d

View File

@@ -2538,6 +2538,22 @@ void Spell::cast(bool skipCheck)
handle_immediate();
}
// Clear combo at finish state
if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo))
{
// Not drop combopoints if negative spell and if any miss on enemy exist
bool needDrop = true;
//if (!IsPositiveSpell(m_spellInfo->Id))
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID!=m_caster->GetGUID()*/)
{
needDrop = false;
break;
}
if (needDrop)
((Player*)m_caster)->ClearComboPoints();
}
SetExecutedCurrently(false);
}
@@ -2951,25 +2967,6 @@ void Spell::finish(bool ok)
m_caster->resetAttackTimer(RANGED_ATTACK);
}
//if (IsRangedAttackResetSpell())
// m_caster->resetAttackTimer(RANGED_ATTACK);
// Clear combo at finish state
if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo))
{
// Not drop combopoints if negative spell and if any miss on enemy exist
bool needDrop = true;
if (!IsPositiveSpell(m_spellInfo->Id))
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
if (ihit->missCondition != SPELL_MISS_NONE && ihit->targetGUID!=m_caster->GetGUID())
{
needDrop = false;
break;
}
if (needDrop)
((Player*)m_caster)->ClearComboPoints();
}
// call triggered spell only at successful cast (after clear combo points -> for add some if need)
if(!m_TriggerSpells.empty())
TriggerSpell();