diff options
| author | megamage <none@none> | 2008-11-14 17:42:00 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-11-14 17:42:00 -0600 |
| commit | 053b671cb5481dacc85fe192ceea937462361948 (patch) | |
| tree | 846406cce519bc8a11b9f4d48b0686974615a53f /src/game/Unit.cpp | |
| parent | bfa9e7516177af9e13391a09d4e1356c74a4c2ba (diff) | |
[svn] Add UNIT_STAT_CASTING, and use it to update attack timer as test.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 15 |
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 ); |
