Fix the unit attack dialog pre-selecting a wrong attack
I forgot to adjust this line for having moved the push_back() below it. Thanks @gfgtdf for bringing this issue to my attention.
This commit is contained in:
parent
927b8aa7d5
commit
336bcda82a
1 changed files with 1 additions and 1 deletions
|
@ -948,7 +948,7 @@ int mouse_handler::fill_weapon_choices(std::vector<battle_context>& bc_vector, u
|
|||
battle_context bc(pc_.gamestate().board_.units_, attacker->get_location(), defender->get_location(), i);
|
||||
if (!bc_vector.empty() && bc.better_attack(bc_vector[best], 0.5)) {
|
||||
// as some weapons can be hidden, i is not a valid index into the resulting vector
|
||||
best = bc_vector.size() - 1;
|
||||
best = bc_vector.size();
|
||||
}
|
||||
bc_vector.push_back(bc);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue