mail[Wesnoth-commits] r33397 - /trunk/src/ai.cpp


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

Header


Content

Posted by alinktomine on March 07, 2009 - 22:28:
Author: alink
Date: Sat Mar  7 22:28:09 2009
New Revision: 33397

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33397&view=rev
Log:
Make the replay also work if the AI manage to cheat by doing impossible moves.

Modified:
    trunk/src/ai.cpp

Modified: trunk/src/ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai.cpp?rev=33397&r1=33396&r2=33397&view=diff
==============================================================================
--- trunk/src/ai.cpp (original)
+++ trunk/src/ai.cpp Sat Mar  7 22:28:09 2009
@@ -580,6 +580,14 @@
                                
up->second.set_facing(before_last->get_relative_dir(*last_step));
                        }
                }
+       }
+       //FIXME: probably missing some "else" here
+       // It looks like if the AI doesn't find a route in possible_move,
+       // she will just teleport her unit between 'from' and 'to'
+       // I suppose this never happen, but in the meantime, add code for 
replay
+       if (steps.empty()) {
+               steps.push_back(from);
+               steps.push_back(to);
        }
 
        std::pair<map_location,unit> *p = info_.units.extract(u_it->first);




Related Messages


Powered by MHonArc, Updated Sat Mar 07 22:40:39 2009