Author: alink
Date: Sun Nov  4 21:51:20 2007
New Revision: 21496

URL: http://svn.gna.org/viewcvs/wesnoth?rev=21496&view=rev
Log:
Fix bug #6304 (Inconsistent unit select/click behaviour)
Now left & right clicks works the same if it's not your turn
(but of course only for allowed actions)
The AI continues to cancel current selection when activating another unit.
Probably not wanted, I will see how it can be changed.

Modified:
    trunk/src/mouse_events.cpp

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=21496&r1=21495&r2=21496&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Sun Nov  4 21:51:20 2007
@@ -995,18 +995,8 @@
                dragging_ = false;
                dragging_started_ = false;
                cursor::set_dragging(false);
-               if (gui_->viewing_team() == team_num_-1 && selected_hex_.valid()
-                               && find_unit(selected_hex_) != units_.end()) {
-                       selected_hex_ = gamemap::location();
-                       gui_->select_hex(gamemap::location());
-                       gui_->set_mouseover_hex_overlay(NULL);
-                       gui_->clear_attack_indicator();
-                       gui_->unhighlight_reach();
-                       current_paths_ = paths();
-                       current_route_.steps.clear();
-                       gui_->set_route(NULL);
-
-                       cursor::set(cursor::NORMAL);
+               if (selected_hex_.valid() && find_unit(selected_hex_) != 
units_.end()) {
+                       select_hex(gamemap::location(), browse);
                } else {
                        gui_->draw(); // redraw highlight (and maybe some more)
                        const theme::menu* const m = 
gui_->get_theme().context_menu();
@@ -1204,7 +1194,7 @@
        gui_->set_route(NULL);
 
        unit_map::iterator u = find_unit(hex);
-       if(u != units_.end() ) {
+       if(hex.valid() && u != units_.end() ) {
                next_unit_ = u->first;
 
                // if it's not the unit's turn, we reset its moves


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to