aboutsummaryrefslogtreecommitdiff
path: root/src/game/UnitAI.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-10 22:48:22 -0500
committermegamage <none@none>2009-05-10 22:48:22 -0500
commit82f886e3c1daa6ae9049bb0c0c0c00219e9735ba (patch)
tree7b8a4bbebf4365c57af8a21694a50aabecf2423a /src/game/UnitAI.cpp
parent904300b4c2f0c708bc98812ec2a0be04249a81d4 (diff)
*Update AI scripts. Use better default AI.
--HG-- branch : trunk
Diffstat (limited to 'src/game/UnitAI.cpp')
-rw-r--r--src/game/UnitAI.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/UnitAI.cpp b/src/game/UnitAI.cpp
index 4914bd36b7c..c991c75603d 100644
--- a/src/game/UnitAI.cpp
+++ b/src/game/UnitAI.cpp
@@ -35,8 +35,11 @@ void UnitAI::AttackStart(Unit *victim)
void UnitAI::DoMeleeAttackIfReady()
{
+ if(me->hasUnitState(UNIT_STAT_CASTING))
+ return;
+
//Make sure our attack is ready and we aren't currently casting before checking distance
- if (me->isAttackReady() && !me->hasUnitState(UNIT_STAT_CASTING))
+ if (me->isAttackReady())
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->getVictim()))
@@ -45,7 +48,7 @@ void UnitAI::DoMeleeAttackIfReady()
me->resetAttackTimer();
}
}
- if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK) && !me->hasUnitState(UNIT_STAT_CASTING))
+ if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
{
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->getVictim()))