src/waypoint.cpp
changeset 9985 9f3177737d88
parent 9978 4c10b20eaf54
child 9986 4ee5b226abad
equal deleted inserted replaced
9984:979b43c921aa 9985:9f3177737d88
   142 {
   142 {
   143 	Waypoint *wp, *best = NULL;
   143 	Waypoint *wp, *best = NULL;
   144 	uint thres = 8;
   144 	uint thres = 8;
   145 
   145 
   146 	FOR_ALL_WAYPOINTS(wp) {
   146 	FOR_ALL_WAYPOINTS(wp) {
   147 		if (wp->deleted) {
   147 		if (wp->deleted && (wp->owner == OWNER_NONE || wp->owner == _current_player)) {
   148 			uint cur_dist = DistanceManhattan(tile, wp->xy);
   148 			uint cur_dist = DistanceManhattan(tile, wp->xy);
   149 
   149 
   150 			if (cur_dist < thres) {
   150 			if (cur_dist < thres) {
   151 				thres = cur_dist;
   151 				thres = cur_dist;
   152 				best = wp;
   152 				best = wp;