arrange a bit the logic when step_left is zero (defend animation related)

This commit is contained in:
Jérémy Rosen 2009-02-09 18:48:09 +00:00
parent 78d6097467
commit a0acc958f3

View file

@ -286,9 +286,9 @@ void unit_attack(
int damage_left = damage;
while(damage_left > 0 && !animator.would_end()) {
int step_left = (animator.get_end_time() - animator.get_animation_time() )/50;
int removed_hp = step_left ? damage_left/step_left : 1;
if(removed_hp < 1) removed_hp = 1;
if(step_left < 1) step_left = 1;
int removed_hp = damage_left/step_left ;
if(removed_hp < 1) removed_hp = 1;
defender.take_hit(removed_hp);
damage_left -= removed_hp;
animator.wait_until(animator.get_animation_time_potential() +50);