AI: ensure multiple weapons are always checked for [disable] special
If the defender has multiple weapons at the range of the attacker weapon, choose_defender_weapon calculates the combat outcome and attacker_combatant_ is set. We still need to check the attack weapon for the [disable] special in this case.
This commit is contained in:
parent
3c98423547
commit
cc986bbc50
1 changed files with 6 additions and 0 deletions
|
@ -534,6 +534,12 @@ int battle_context::choose_attacker_weapon(const unit &attacker,
|
|||
attacker_combatant_ = new combatant(*attacker_stats_);
|
||||
defender_combatant_ = new combatant(*defender_stats_, prev_def);
|
||||
attacker_combatant_->fight(*defender_combatant_);
|
||||
} else {
|
||||
if (attacker_stats_->disable) {
|
||||
delete attacker_stats_;
|
||||
attacker_stats_ = nullptr;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!best_att_comb || better_combat(*attacker_combatant_, *defender_combatant_,
|
||||
*best_att_comb, *best_def_comb, harm_weight)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue