Skip to content

Commit

Permalink
Fix bug #21448: make premoved units selection like in Wesnoth 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Coffee-- committed May 3, 2014
1 parent 6eb14d3 commit ffb83a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -117,6 +117,7 @@ Version 1.13.0-dev:
* Fix implementation bug in random number generator: rand_pool_ is now an
unsigned long rather than an unsigned int.
* Fix bug #21491: fix drag+drop for unit movements
* Fix bug #21448: make premoved units selection like in Wesnoth 1.10

Version 1.11.11:
* Add-ons server:
Expand Down
1 change: 1 addition & 0 deletions players_changelog
Expand Up @@ -36,6 +36,7 @@ Version 1.13.0-dev:
using the "play_side" button, thus matching the behavior of the rest of
wesnoth. Bug fix #21025.
* Fix bug stopping drag+drop for unit movements
* Revert premoved units selection to Wesnoth 1.10 behavior (#21448)

Version 1.11.11:
* Campaigns:
Expand Down
10 changes: 7 additions & 3 deletions src/mouse_events.cpp
Expand Up @@ -500,12 +500,16 @@ void mouse_handler::select_or_action(bool browse)

unit_map::iterator clicked_u = find_unit(last_hex_);
unit_map::iterator selected_u = find_unit(selected_hex_);
if ( (clicked_u != resources::units->end() && clicked_u->side() == side_num_)
|| ((selected_u == resources::units->end()) && (clicked_u != resources::units->end()))
|| ((selected_u != resources::units->end() && selected_u->side() != side_num_ && clicked_u != resources::units->end())) )
if ( clicked_u != resources::units->end() &&
((selected_u == resources::units->end()) ||
(selected_u != resources::units->end() && selected_u->side() != side_num_)) )
{
select_hex(last_hex_, false);
}
else
{
move_action(browse);
}
}

void mouse_handler::move_action(bool browse)
Expand Down

0 comments on commit ffb83a9

Please sign in to comment.