src/waypoint.cpp
branchnoai
changeset 10249 58810805030e
parent 10142 56ee7da4ad56
child 10355 ee4b5f7a5bf2
equal deleted inserted replaced
10216:794533ba4cbf 10249:58810805030e
    98 	WaypointID cid = 0; // current index, goes to GetWaypointPoolSize()-1, then wraps to 0
    98 	WaypointID cid = 0; // current index, goes to GetWaypointPoolSize()-1, then wraps to 0
    99 	do {
    99 	do {
   100 		Waypoint *lwp = GetWaypoint(cid);
   100 		Waypoint *lwp = GetWaypoint(cid);
   101 
   101 
   102 		/* check only valid waypoints... */
   102 		/* check only valid waypoints... */
   103  		if (lwp->IsValid() && wp != lwp) {
   103 		if (lwp->IsValid() && wp != lwp) {
   104 			/* only waypoints with 'generic' name within the same city */
   104 			/* only waypoints with 'generic' name within the same city */
   105 			if (lwp->name == NULL && lwp->town_index == wp->town_index) {
   105 			if (lwp->name == NULL && lwp->town_index == wp->town_index) {
   106 				/* if lwp->town_cn < next, uint will overflow to '+inf' */
   106 				/* if lwp->town_cn < next, uint will overflow to '+inf' */
   107 				uint i = (uint)lwp->town_cn - next;
   107 				uint i = (uint)lwp->town_cn - next;
   108 
   108