aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2009-05-20 22:39:52 +0200
committerthenecromancer <none@none>2009-05-20 22:39:52 +0200
commit6ebfe2f5803cb95bc8f2710892548a60ebe6f63d (patch)
tree6e1dc2c87d62dc5f091ffbdfd97b70c50b55b9f5 /src/game/SpellEffects.cpp
parent883cd02304924f04e36306497cf0d36ab373d957 (diff)
Correct behavior of Add Extra Attact spelleffect.
Correctly send attack gain in spell log. Attack right after processing effect Ignore effect if target not in melee range/angle --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index a1cf876fc6c..89b92ccdc61 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5441,7 +5441,20 @@ void Spell::EffectAddExtraAttacks(uint32 /*i*/)
if( unitTarget->m_extraAttacks )
return;
+ Unit *victim = unitTarget->getVictim();
+
+ // attack prevented
+ // fixme, some attacks may not target current victim, this is right now not handled
+ if (!victim || !unitTarget->IsWithinMeleeRange(victim) || !unitTarget->HasInArc( 2*M_PI/3, victim ))
+ return;
+
+ // Only for proc/log informations
unitTarget->m_extraAttacks = damage;
+ // Need to send log before attack is made
+ SendLogExecute();
+ m_needSpellLog = false;
+
+ unitTarget->AttackerStateUpdate(victim, BASE_ATTACK, true);
}
void Spell::EffectParry(uint32 /*i*/)