Skip to content

Commit

Permalink
Make a unit respond to mouse-clicks after end_unit_turn (fixes #4466)
Browse files Browse the repository at this point in the history
This was an edge-case when the player had only one unit.
  • Loading branch information
stevecotton committed Oct 16, 2019
1 parent bf01a3a commit bd9ad78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/menu_events.cpp
Expand Up @@ -997,6 +997,12 @@ void menu_handler::end_unit_turn(mouse_handler& mousehandler, int side_num)
if(un->user_end_turn()) {
mousehandler.cycle_units(false);
}

// If cycle_units hasn't found a new unit to cycle to then the original unit is still selected, but
// in a state where left-clicking on it does nothing. Make it respond to mouse clicks again.
if(un == units().find(mousehandler.get_selected_hex())) {
mousehandler.deselect_hex();
}
}
}

Expand Down

0 comments on commit bd9ad78

Please sign in to comment.