summaryrefslogtreecommitdiff
path: root/waypoint.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 16:46:32 +0000
committertruelight <truelight@openttd.org>2006-08-26 16:46:32 +0000
commit5dc121d1c1b73261de4877896173b7b4d01e764f (patch)
treeaa8da22d3b3ff6be89bfd4a179fcc4da3e91518a /waypoint.h
parentdb8dfcd6e90f13ed0aafec06fc5975967afb1bb5 (diff)
downloadopenttd-5dc121d1c1b73261de4877896173b7b4d01e764f.tar.xz
(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.
Diffstat (limited to 'waypoint.h')
-rw-r--r--waypoint.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/waypoint.h b/waypoint.h
index 9949ffaa4..da3106656 100644
--- a/waypoint.h
+++ b/waypoint.h
@@ -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)