diff options
Diffstat (limited to 'src/vehicle.h')
-rw-r--r-- | src/vehicle.h | 12 |
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) |