Author: dragonking
Date: Fri Oct 10 01:24:57 2008
New Revision: 30000

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30000&view=rev
Log:
Made move() formula reset remaining movmement of unit to 0

Modified:
    trunk/src/formula_ai.cpp

Modified: trunk/src/formula_ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/formula_ai.cpp?rev=30000&r1=29999&r2=30000&view=diff
==============================================================================
--- trunk/src/formula_ai.cpp (original)
+++ trunk/src/formula_ai.cpp Fri Oct 10 01:24:57 2008
@@ -1519,6 +1519,12 @@
                                }
 
                                move_unit(move->src(), destination, 
possible_moves_);
+                               unit_map::iterator unit = 
get_info().units.find(destination);
+                               if(unit != get_info().units.end()) {
+                                       unit->second.set_movement(0);
+                               } else {
+                                       throw formula_error("Incorrect result 
of calling the move() formula", "", "", 0);;
+                               }
                                made_move = true;
                        }
                } else if(attack) {


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

Reply via email to