mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 00:03:28 +00:00
Make the info in sidebar also use "swarm_attacks_max".
And fix a mathematical error there, but was probably hidden by bug #12630
This commit is contained in:
parent
afb6433d6f
commit
90bea21bd5
@ -240,12 +240,12 @@ Units cannot be killed by poison alone. The poison will not reduce it below 1 HP
|
||||
// Compute swarm attacks:
|
||||
unit_ability_list swarm = at_it->get_specials("swarm");
|
||||
if(!swarm.empty()) {
|
||||
int swarm_max_attacks = swarm.highest("attacks_max",nattacks).first;
|
||||
int swarm_min_attacks = swarm.highest("attacks_min").first;
|
||||
int swarm_max_attacks = swarm.highest("swarm_attacks_max",nattacks).first;
|
||||
int swarm_min_attacks = swarm.highest("swarm_attacks_min").first;
|
||||
int hitp = u->second.hitpoints();
|
||||
int mhitp = u->second.max_hitpoints();
|
||||
|
||||
nattacks = swarm_min_attacks + swarm_max_attacks * hitp / mhitp;
|
||||
nattacks = swarm_min_attacks + (swarm_max_attacks - swarm_min_attacks) * hitp / mhitp;
|
||||
|
||||
} else {
|
||||
nattacks = at_it->num_attacks();
|
||||
|
Loading…
x
Reference in New Issue
Block a user