Fix bug where no defense weapon ended up with low score.

This commit is contained in:
Rusty Russell 2006-04-29 01:08:55 +00:00
parent 8ca6b0c296
commit 025c9b619e

View file

@ -948,7 +948,9 @@ unsigned int battle_context::rate_attacker_weapon(double attack_weight) const
attack_weight /= 2;
attack_weight *= attacker_stats_->num_blows * attacker_stats_->damage;
attack_weight /= defender_stats_->num_blows * defender_stats_->damage;
if (defender_stats_->num_blows * defender_stats_->damage)
attack_weight /= defender_stats_->num_blows * defender_stats_->damage;
return (unsigned int)(attack_weight * 100);
}