diff options
| author | megamage <none@none> | 2009-08-17 22:34:18 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-08-17 22:34:18 -0500 |
| commit | 6701d3d24f80e876aecca9b2086e06464f67fce8 (patch) | |
| tree | 1b10a7e69d49643b5b586be78b3095e4bd885604 /src/game/Unit.cpp | |
| parent | 7c2db4f2a9c55869c44b848fef9daf43091e981e (diff) | |
*Script for quest "An End To All Things..."
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8053944f9ea..64fdc7d845d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8152,10 +8152,19 @@ bool Unit::Attack(Unit *victim, bool meleeAttack) if (m_attacking == victim) { // switch to melee attack from ranged/magic - if( meleeAttack && !hasUnitState(UNIT_STAT_MELEE_ATTACKING) ) + if(meleeAttack) { - addUnitState(UNIT_STAT_MELEE_ATTACKING); - SendMeleeAttackStart(victim); + if(!hasUnitState(UNIT_STAT_MELEE_ATTACKING)) + { + addUnitState(UNIT_STAT_MELEE_ATTACKING); + SendMeleeAttackStart(victim); + return true; + } + } + else if(hasUnitState(UNIT_STAT_MELEE_ATTACKING)) + { + clearUnitState(UNIT_STAT_MELEE_ATTACKING); + SendMeleeAttackStop(victim); return true; } return false; |
