Skip to content

Commit

Permalink
Make sure any alternate unit is selected properly on movement+attack
Browse files Browse the repository at this point in the history
  • Loading branch information
Coffee-- committed May 4, 2014
1 parent 4d24df6 commit 233dc2a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/mouse_events.cpp
Expand Up @@ -609,11 +609,17 @@ void mouse_handler::move_action(bool browse)
save_whiteboard_attack(attack_from, hex, choice);
}
else if ( move_unit_along_current_route() ) {
bool alt_unit_selected = (selected_hex_ != src);
src = selected_hex_;
// clear current unit selection so that any other unit selected
// triggers a new selection
selected_hex_ = map_location();

attack_enemy(attack_from, hex, choice); // Fight !!
if (alt_unit_selected && !selected_hex_.valid()) {
//reselect other unit if selected during movement animation
select_hex(src, browse);
}
}
//TODO: Maybe store the attack choice so "press t to continue"
// can also continue the attack?
Expand Down

0 comments on commit 233dc2a

Please sign in to comment.