mail[Wesnoth-commits] r44350 - in /trunk/src: mouse_events.cpp whiteboard/move.cpp


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

Header


Content

Posted by gabrielmorin on July 19, 2010 - 11:04:
Author: gabba
Date: Mon Jul 19 11:04:26 2010
New Revision: 44350

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44350&view=rev
Log:
Whiteboard: more progress toward planning outside your turn.

Modified:
    trunk/src/mouse_events.cpp
    trunk/src/whiteboard/move.cpp

Modified: trunk/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mouse_events.cpp?rev=44350&r1=44349&r2=44350&view=diff
==============================================================================
--- trunk/src/mouse_events.cpp (original)
+++ trunk/src/mouse_events.cpp Mon Jul 19 11:04:26 2010
@@ -533,7 +533,8 @@
        //otherwise we're trying to move to a hex
        else if(!commands_disabled && (!browse || 
resources::whiteboard->is_active()) &&
                        selected_hex_.valid() && selected_hex_ != hex &&
-                u != units_.end() && u->side() == side_num_ &&
+                u != units_.end() &&
+                (u->side() == side_num_ || 
resources::whiteboard->is_active()) &&
                     clicked_u == units_.end() && 
!current_route_.steps.empty() &&
                     current_route_.steps.front() == selected_hex_) {
 

Modified: trunk/src/whiteboard/move.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/move.cpp?rev=44350&r1=44349&r2=44350&view=diff
==============================================================================
--- trunk/src/whiteboard/move.cpp (original)
+++ trunk/src/whiteboard/move.cpp Mon Jul 19 11:04:26 2010
@@ -79,7 +79,11 @@
                pathfind::plain_route route = 
pathfind::a_star_search(source_hex_,
                                dest_hex_, 10000, &path_calc, 
resources::game_map->w(), resources::game_map->h());
 
-               assert(unit_.movement_left() - route.move_cost >= 0);
+               // TODO: find a better treatment of movement points when 
defining moves out-of-turn
+               if(unit_.movement_left() - route.move_cost < 0
+                               && resources::controller->current_side() == 
resources::screen->viewing_side()) {
+                       WRN_WB << "Move defined with insufficient movement 
left.\n";
+               }
 
                //TODO: if unit finishes move in a village, set the move cost 
to unit_.movement_left()
 




Related Messages


Powered by MHonArc, Updated Mon Jul 19 11:20:13 2010