summaryrefslogtreecommitdiff
path: root/waypoint.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-04-22 05:41:09 +0000
committertron <tron@openttd.org>2005-04-22 05:41:09 +0000
commitcadc38eb49af38175ac65013b0f9986c02921ea8 (patch)
treee61fcdfaeec4a6e98da15bb107eb3513d0fa1fa8 /waypoint.h
parent9bda9327e18da83a48593065618fdc333f1bfc8e (diff)
downloadopenttd-cadc38eb49af38175ac65013b0f9986c02921ea8.tar.xz
(svn r2222) Check the parameters of Cmd{Insert,Delete,Modify,Skip}Order() and CmdRestoreOrderIndex():
- Check if the vehicle exists - Check if the vehicle belongs to the correct player - Check if the new order is valid (type, destination, flags) (CmdInsertOrder)
Diffstat (limited to 'waypoint.h')
-rw-r--r--waypoint.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/waypoint.h b/waypoint.h
index 186b8c154..a7f9f968a 100644
--- a/waypoint.h
+++ b/waypoint.h
@@ -40,6 +40,11 @@ static inline uint16 GetWaypointPoolSize(void)
return _waypoint_pool.total_items;
}
+static inline bool IsWaypointIndex(uint index)
+{
+ return index < GetWaypointPoolSize();
+}
+
#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1 < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1) : NULL)
#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)