skip teleport to the same location when animating a unit's move

This commit is contained in:
Ali El Gariani 2009-03-15 12:26:56 +00:00
parent 7ce240ee5c
commit 545dbe024d

View File

@ -156,10 +156,12 @@ void move_unit(const std::vector<map_location>& path, unit& u, const std::vector
temp_unit.get_animation()->restart_animation();
}
if( !tiles_adjacent(path[i], path[i+1])) {
if(tiles_adjacent(path[i], path[i+1])) {
move_unit_between(path[i],path[i+1],temp_unit);
} else if (path[i] != path[i+1]) {
teleport_unit_between(path[i],path[i+1],temp_unit);
} else {
move_unit_between(path[i],path[i+1],temp_unit);
continue; // no move needed
}
}
}