aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d1a1c128744..0ca07ff2c1c 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -283,12 +283,15 @@ void Unit::Update( uint32 p_time )
}
}
- if(uint32 base_att = getAttackTimer(BASE_ATTACK))
- setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time) );
- if(uint32 ranged_att = getAttackTimer(RANGED_ATTACK))
- setAttackTimer(RANGED_ATTACK, (p_time >= ranged_att ? 0 : ranged_att - p_time) );
- if(uint32 off_att = getAttackTimer(OFF_ATTACK))
- setAttackTimer(OFF_ATTACK, (p_time >= off_att ? 0 : off_att - p_time) );
+ if(!hasUnitState(UNIT_STAT_CASTING))
+ {
+ if(uint32 base_att = getAttackTimer(BASE_ATTACK))
+ setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time) );
+ if(uint32 ranged_att = getAttackTimer(RANGED_ATTACK))
+ setAttackTimer(RANGED_ATTACK, (p_time >= ranged_att ? 0 : ranged_att - p_time) );
+ if(uint32 off_att = getAttackTimer(OFF_ATTACK))
+ setAttackTimer(OFF_ATTACK, (p_time >= off_att ? 0 : off_att - p_time) );
+ }
// update abilities available only for fraction of time
UpdateReactives( p_time );