Skip to content

Commit

Permalink
Make the mouse handler respect linger mode instead of assuming false.
Browse files Browse the repository at this point in the history
Fixes bug #21450, restoring functionality lost in commit
7e46df9.
  • Loading branch information
Ja-MiT committed Feb 23, 2014
1 parent 4ae8e5f commit 3b69ba8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -3,6 +3,8 @@ Version 1.11.10+dev:
* Updated translations:
* WML engine:
* Bug #21643: Removing fog from a single hex no longer makes the hex ugly.
* Miscellaneous and bug fixes:
* Units can no longer be moved in linger mode (bug #21450).

Version 1.11.10:
* Add-ons client:
Expand Down
2 changes: 2 additions & 0 deletions players_changelog
Expand Up @@ -5,6 +5,8 @@ changelog: https://github.com/wesnoth/wesnoth-old/blob/master/changelog
Version 1.11.10+dev:
* Language and i18n:
* Updated translations:
* Miscellaneous and bug fixes:
* Units can no longer be moved in linger mode (bug #21450).


Version 1.11.10:
Expand Down
8 changes: 3 additions & 5 deletions src/mouse_events.cpp
Expand Up @@ -493,7 +493,7 @@ void mouse_handler::mouse_wheel_right(int /*x*/, int /*y*/, const bool /*browse*
resources::controller->set_button_state(*gui_);
}

void mouse_handler::select_or_action()
void mouse_handler::select_or_action(bool browse)
{
if (!resources::game_map->on_board(last_hex_))
return;
Expand All @@ -505,13 +505,11 @@ void mouse_handler::select_or_action()
|| ((selected_u != resources::units->end() && selected_u->side() != side_num_ && clicked_u != resources::units->end())) )
select_hex(last_hex_, false);
else
move_action();
move_action(browse);
}

void mouse_handler::move_action()
void mouse_handler::move_action(bool browse)
{
bool browse = false;

// Lock whiteboard activation state to avoid problems due to
// its changing while an animation takes place.
wb::whiteboard_lock wb_lock = resources::whiteboard->get_activation_state_lock();
Expand Down
4 changes: 2 additions & 2 deletions src/mouse_events.hpp
Expand Up @@ -73,9 +73,9 @@ class mouse_handler : public mouse_handler_base {
const bool highlight = true,
const bool fire_event = true);

void move_action();
void move_action(bool browse);

void select_or_action();
void select_or_action(bool browse);

void left_mouse_up(int x, int y, const bool /*browse*/);
void mouse_wheel_up(int x, int y, const bool /*browse*/);
Expand Down
4 changes: 2 additions & 2 deletions src/play_controller.cpp
Expand Up @@ -461,11 +461,11 @@ void play_controller::left_mouse_click(){
}

void play_controller::select_and_action() {
mouse_handler_.select_or_action();
mouse_handler_.select_or_action(browse_);
}

void play_controller::move_action(){
mouse_handler_.move_action();
mouse_handler_.move_action(browse_);
}

void play_controller::deselect_hex(){
Expand Down

0 comments on commit 3b69ba8

Please sign in to comment.