Skip to content

Commit

Permalink
Fix the unit attack dialog pre-selecting a wrong attack
Browse files Browse the repository at this point in the history
I forgot to adjust this line for having moved the push_back() below it.

Thanks @gfgtdf for bringing this issue to my attention.
  • Loading branch information
jyrkive committed Aug 14, 2016
1 parent 927b8aa commit 336bcda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mouse_events.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 336bcda

Please sign in to comment.