From 3b69ba802bd69b5bcb96d6fe95622396442c2303 Mon Sep 17 00:00:00 2001 From: JaMiT Date: Sun, 23 Feb 2014 02:07:05 -0600 Subject: [PATCH] Make the mouse handler respect linger mode instead of assuming false. Fixes bug #21450, restoring functionality lost in commit 7e46df919167c6906d7a782b8f77104444cdee5a. --- changelog | 2 ++ players_changelog | 2 ++ src/mouse_events.cpp | 8 +++----- src/mouse_events.hpp | 4 ++-- src/play_controller.cpp | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/changelog b/changelog index a7625d3f3016..641e89361a01 100644 --- a/changelog +++ b/changelog @@ -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: diff --git a/players_changelog b/players_changelog index f9a3f3b68e33..c0468839f8a5 100644 --- a/players_changelog +++ b/players_changelog @@ -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: diff --git a/src/mouse_events.cpp b/src/mouse_events.cpp index a4d34184c117..f56e38e77417 100644 --- a/src/mouse_events.cpp +++ b/src/mouse_events.cpp @@ -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; @@ -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(); diff --git a/src/mouse_events.hpp b/src/mouse_events.hpp index 26df15565414..1437e8ff10fa 100644 --- a/src/mouse_events.hpp +++ b/src/mouse_events.hpp @@ -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*/); diff --git a/src/play_controller.cpp b/src/play_controller.cpp index 6a7e976e9464..2d8aa161a04f 100644 --- a/src/play_controller.cpp +++ b/src/play_controller.cpp @@ -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(){