depot.h
changeset 1718 cef0773365eb
parent 1650 12a20779af79
child 1790 4afb4b4e4278
--- a/depot.h	Thu Apr 21 16:20:38 2005 +0000
+++ b/depot.h	Fri Apr 22 05:41:09 2005 +0000
@@ -28,6 +28,11 @@
 	return _depot_pool.total_items;
 }
 
+static inline bool IsDepotIndex(uint index)
+{
+	return index < GetDepotPoolSize();
+}
+
 #define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1 < GetDepotPoolSize()) ? GetDepot(d->index + 1) : NULL)
 #define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
 
@@ -44,7 +49,7 @@
 /**
  * Check if a depot really exists.
  */
-static inline bool IsValidDepot(Depot* depot)
+static inline bool IsValidDepot(const Depot* depot)
 {
 	return depot->xy != 0; /* XXX: Replace by INVALID_TILE someday */
 }