mail[Wesnoth-commits] r41547 - in /trunk: changelog src/actions.cpp


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

Header


Content

Posted by terraninfo on March 12, 2010 - 00:21:
Author: crab
Date: Fri Mar 12 00:21:20 2010
New Revision: 41547

URL: http://svn.gna.org/viewcvs/wesnoth?rev=41547&view=rev
Log:
fix bug #15013: make AI gotos persist between turns when set by WML, make the 
AI don't use gotos for normal moves.

Modified:
    trunk/changelog
    trunk/src/actions.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=41547&r1=41546&r2=41547&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Fri Mar 12 00:21:20 2010
@@ -2,6 +2,8 @@
  * AI:
    * fix bug #15390: add a try_delete action to modify_ai which has
      'delete if exists, don't complain if not exists' semantics
+   * fix bug #15013: make AI gotos persist between turns when set by
+     WML, make the AI don't use gotos for normal moves.
  * Language and i18n:
    * Updated translations: Chinese (Traditional), Japanese
 

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=41547&r1=41546&r2=41547&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Fri Mar 12 00:21:20 2010
@@ -2186,7 +2186,11 @@
 
        assert(ui != units.end());
 
-       ui->second.set_goto(map_location());
+       //don't modify goto if we're have a spectator
+       //if it is present, then the caller code is responsible for modifying 
gotos
+       if (move_spectator==NULL) {
+               ui->second.set_goto(map_location());
+       }
 
        size_t team_num = ui->second.side()-1;
        team *tm = &teams[team_num];
@@ -2366,7 +2370,12 @@
                if(seen_units.empty() == false) {
                        ui->second.set_interrupted_move(route.back());
                } else {
-                       ui->second.set_goto(route.back());
+
+                       //don't modify goto if we're have a spectator
+                       //if it is present, then the caller code is 
responsible for modifying gotos
+                       if (move_spectator==NULL) {
+                               ui->second.set_goto(route.back());
+                       }
                }
        } else {
                ui->second.set_interrupted_move(map_location());




Related Messages


Powered by MHonArc, Updated Fri Mar 12 00:40:11 2010