(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)
This commit is contained in:
tron
2005-04-22 05:41:09 +00:00
parent 591217da4a
commit 6ceeedfd3c
4 changed files with 183 additions and 8 deletions

View File

@@ -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)