arrange a bit the logic when step_left is zero (defend animation related)
This commit is contained in:
parent
78d6097467
commit
a0acc958f3
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue