Author: darthfool
Date: Sat Apr 21 14:04:59 2007
New Revision: 16952
URL: http://svn.gna.org/viewcvs/wesnoth?rev=16952&view=rev
Log:
fixed check in ai move to make sure that the chosen path actually moves off the
initial starting point before checking to see if there are units along the path.
Modified:
trunk/src/ai.cpp
Modified: trunk/src/ai.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai.cpp?rev=16952&r1=16951&r2=16952&view=diff
==============================================================================
--- trunk/src/ai.cpp (original)
+++ trunk/src/ai.cpp Sat Apr 21 14:04:59 2007
@@ -427,7 +427,7 @@
LOG_AI << "\tresetting to " << from << " ->
" << to << '\n';
}
- if(steps.empty() == false) {
+ if(steps.size()>1) { //first step is starting hex
unit_map::const_iterator
utest=info_.units.find(*(steps.begin()+1));
if(utest != info_.units.end() &&
current_team().is_enemy(utest->second.side())){
LOG_STREAM(err, ai) << "AI tried to move onto
existing enemy unit at"<<*(steps.begin())<<"\n";
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits