aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-04-09 00:54:08 +0200
committerQAston <none@none>2009-04-09 00:54:08 +0200
commit31a0ffa4ca9d1da8cfcffd35ff430f47ea5e0bdb (patch)
tree08bc522c53d3efcce530be10bb53978c5422c5b7 /src
parente3272f2b0a3b7ce2e215614b2f5655a677e1c99c (diff)
*Fix Slice and Dice and other multitarget spells using combopoints in effects.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 9fc6dbffcc7..e6b7499f813 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1022,14 +1022,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo);
}
- // Take combo points after effects handling (combo points are used in effect handling)
- if(!m_IsTriggeredSpell && !m_CastItem
- && NeedsComboPoints(m_spellInfo)
- && m_caster->GetTypeId()==TYPEID_PLAYER
- && target->targetGUID == m_targets.getUnitTargetGUID()
- && (missInfo == SPELL_MISS_NONE || missInfo == SPELL_MISS_MISS))
- ((Player*)m_caster)->ClearComboPoints();
-
// Call scripted function for AI if this spell is casted upon a creature (except pets)
if(IS_CREATURE_GUID(target->targetGUID))
{
@@ -2426,8 +2418,23 @@ void Spell::handle_immediate()
// process immediate effects (items, ground, etc.) also initialize some variables
_handle_immediate_phase();
+ bool checkCp =
+ !m_IsTriggeredSpell && !m_CastItem
+ && NeedsComboPoints(m_spellInfo)
+ && m_caster->GetTypeId()==TYPEID_PLAYER;
+ bool comboPoints = false;
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
+ {
DoAllEffectOnTarget(&(*ihit));
+ // Take combo points after effects handling (combo points are used in effect handling)
+ if(checkCp)
+ if(ihit->targetGUID == m_targets.getUnitTargetGUID()
+ && (ihit->missCondition == SPELL_MISS_NONE || ihit->missCondition == SPELL_MISS_MISS))
+ comboPoints=true;
+ }
+ // Take for real after all targets are processed
+ if (comboPoints)
+ ((Player*)m_caster)->ClearComboPoints();
for(std::list<GOTargetInfo>::iterator ihit= m_UniqueGOTargetInfo.begin();ihit != m_UniqueGOTargetInfo.end();++ihit)
DoAllEffectOnTarget(&(*ihit));