summaryrefslogtreecommitdiff
path: root/src/vehicle.h
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-21 00:13:39 +0000
committerbjarni <bjarni@openttd.org>2007-01-21 00:13:39 +0000
commit7871ce1879d3dba99cdfecc50a41d571a8f7438a (patch)
tree0d76459c94065804ab7100442d97b4ef070361a0 /src/vehicle.h
parentc8c27b974058e5c6673ed7a7d0bdd2eb623d4295 (diff)
downloadopenttd-7871ce1879d3dba99cdfecc50a41d571a8f7438a.tar.xz
(svn r8294) -Fix: deleting a vehicle with shared orders, but no orders would fail to reset prev_shared and next_shared
-As a result, vehicles in the game could end up having prev/next pointers to vehicles, that was no longer in the game
Diffstat (limited to 'src/vehicle.h')
-rw-r--r--src/vehicle.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vehicle.h b/src/vehicle.h
index 85b74135d..d831058d2 100644
--- a/src/vehicle.h
+++ b/src/vehicle.h
@@ -407,6 +407,18 @@ static inline void DeleteVehicle(Vehicle *v)
v->type = 0;
}
+static inline bool IsPlayerBuildableVehicleType(const Vehicle *v)
+{
+ switch (v->type) {
+ case VEH_Train:
+ case VEH_Road:
+ case VEH_Ship:
+ case VEH_Aircraft:
+ return true;
+ }
+ return false;
+}
+
#define FOR_ALL_VEHICLES_FROM(v, start) for (v = GetVehicle(start); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) if (IsValidVehicle(v))
#define FOR_ALL_VEHICLES(v) FOR_ALL_VEHICLES_FROM(v, 0)