[svn] Add UNIT_STAT_CASTING, and use it to update attack timer as test.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-14 17:42:00 -06:00
parent bfa9e75161
commit 053b671cb5
3 changed files with 19 additions and 11 deletions

View File

@@ -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 );