(svn r6143) -Codechange: DeleteWaypoint removes a waypoint from the pool
-Codechange: DestroyWaypoint is called by DeleteWaypoint to remove all things where a waypoint depends on. Last 2 changes to prepare for new pool system. Not pretty now, will be soon.
This commit is contained in:
@@ -55,6 +55,14 @@ static inline bool IsValidWaypointID(WaypointID index)
|
||||
return index < GetWaypointPoolSize() && IsValidWaypoint(GetWaypoint(index));
|
||||
}
|
||||
|
||||
void DestroyWaypoint(Waypoint *wp);
|
||||
|
||||
static inline void DeleteWaypoint(Waypoint *wp)
|
||||
{
|
||||
DestroyWaypoint(wp);
|
||||
wp->xy = 0;
|
||||
}
|
||||
|
||||
#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1 < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1) : NULL) if (IsValidWaypoint(wp))
|
||||
#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user