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


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

Header


Content

Posted by alinktomine on March 01, 2009 - 18:28:
Author: alink
Date: Sun Mar  1 18:28:48 2009
New Revision: 33250

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33250&view=rev
Log:
Selecting another unit during a unit's move never fired the select event.
Fix this by firing it at the end of the first unit's move, this also triggers
select animation and sound at that time.

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=33250&r1=33249&r2=33250&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Sun Mar  1 18:28:48 2009
@@ -411,13 +411,20 @@
 
                gui().unhighlight_reach();
                move_unit_along_current_route(check_shroud);
+               // during the move, we may have selected another unit
+               // (but without triggering a select event (command was 
disabled)
+               // in that case reselect it now to fire the event (+ anim & 
sound)
+               if (selected_hex_ != src) {
+                       select_hex(selected_hex_, browse);
+               }
+               return false;
        } else if (!attackmove_) {
                // we select a (maybe empty) hex
                // we block selection during attack+move (because motion is 
blocked)
-               // FIXME: deal with selected event when commands_disabled
                select_hex(hex, browse);
        }
        return false;
+       //FIXME: clean all these "return false"
 }
 
 void mouse_handler::select_hex(const map_location& hex, const bool browse) {
@@ -447,7 +454,6 @@
                if (!browse && !commands_disabled && u->second.side() == 
gui().viewing_team()+1) {
                        sound::play_UI_sound("select-unit.wav");
                        u->second.set_selecting(gui(), u->first);
-
                        game_events::fire("select", hex);
                }
 




Related Messages


Powered by MHonArc, Updated Sun Mar 01 18:40:06 2009