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.
This commit is contained in:
John W. C. McNabb 2007-04-21 12:04:59 +00:00
parent b1cbb50134
commit 7e654b56e8

View File

@ -427,7 +427,7 @@ gamemap::location ai_interface::move_unit_partial(location from, location to,
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";