mail[Wesnoth-commits] r44895 - /trunk/src/mouse_events.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by gabrielmorin on July 30, 2010 - 04:00:
Author: gabba
Date: Fri Jul 30 04:00:47 2010
New Revision: 44895

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44895&view=rev
Log:
Whiteboard: code simplification in mouse_handler::left_click().

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=44895&r1=44894&r2=44895&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Fri Jul 30 04:00:47 2010
@@ -478,19 +478,17 @@
        //see if we're trying to do a attack or move-and-attack
        if((!browse || resources::whiteboard->is_active()) && 
!commands_disabled && attack_from.valid()) {
                if (resources::whiteboard->is_active() && clicked_u.valid()) {
-                       //if  (resources::whiteboard->has_selected_unit()) {
-                               // Unselect the current hex, and create 
planned attack for whiteboard
-                               selected_hex_ = map_location();
-                               gui().select_hex(map_location());
-                               gui().clear_attack_indicator();
-                               gui().set_route(NULL);
-                               waypoints_.clear();
-                               show_partial_move_ = false;
-                               gui().unhighlight_reach();
-                               current_paths_ = pathfind::paths();
-                               current_route_.steps.clear();
-                               
resources::whiteboard->save_temp_attack(attack_from, 
clicked_u->get_location());
-                       //}
+                       // Unselect the current hex, and create planned 
attack for whiteboard
+                       selected_hex_ = map_location();
+                       gui().select_hex(map_location());
+                       gui().clear_attack_indicator();
+                       gui().set_route(NULL);
+                       waypoints_.clear();
+                       show_partial_move_ = false;
+                       gui().unhighlight_reach();
+                       current_paths_ = pathfind::paths();
+                       current_route_.steps.clear();
+                       resources::whiteboard->save_temp_attack(attack_from, 
clicked_u->get_location());
                return false;
                } else if (u.valid() && clicked_u.valid()) {
                        if (attack_from == selected_hex_) { //no move needed
@@ -579,10 +577,9 @@
                                gui().unhighlight_reach();
                                current_paths_ = pathfind::paths();
                                current_route_.steps.clear();
-                               if (resources::whiteboard->has_temp_move())
-                               {
-                                       
resources::whiteboard->save_temp_move();
-                               }
+
+                               resources::whiteboard->save_temp_move();
+
                // Otherwise proceed to normal unit movement, unless the 
selected unit already has actions
                // from the whiteboard.
                } else if (!resources::whiteboard->unit_has_actions(*u)) {




Related Messages


Powered by MHonArc, Updated Fri Jul 30 04:20:26 2010