12 #ifndef VEHICLE_FUNC_H
13 #define VEHICLE_FUNC_H
25 #define is_custom_sprite(x) (x >= 0xFD)
26 #define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)
27 #define IS_CUSTOM_SECONDHEAD_SPRITE(x) (x == 0xFE)
38 template <VehicleType T>
44 uint CountVehiclesInChain(
const Vehicle *v);
49 void CallVehicleTicks();
55 void ResetVehicleHash();
56 void ResetVehicleColourMap();
66 void CheckVehicleBreakdown(
Vehicle *v);
100 default:
return false;
120 extern const uint32 _veh_build_proc_table[];
121 extern const uint32 _veh_sell_proc_table[];
122 extern const uint32 _veh_refit_proc_table[];
123 extern const uint32 _send_to_depot_proc_table[];
126 static inline uint32 GetCmdBuildVeh(
VehicleType type)
128 return _veh_build_proc_table[type];
131 static inline uint32 GetCmdBuildVeh(
const BaseVehicle *v)
133 return GetCmdBuildVeh(v->
type);
136 static inline uint32 GetCmdSellVeh(
VehicleType type)
138 return _veh_sell_proc_table[type];
141 static inline uint32 GetCmdSellVeh(
const BaseVehicle *v)
143 return GetCmdSellVeh(v->
type);
146 static inline uint32 GetCmdRefitVeh(
VehicleType type)
148 return _veh_refit_proc_table[type];
151 static inline uint32 GetCmdRefitVeh(
const BaseVehicle *v)
153 return GetCmdRefitVeh(v->
type);
156 static inline uint32 GetCmdSendToDepot(
VehicleType type)
158 return _send_to_depot_proc_table[type];
161 static inline uint32 GetCmdSendToDepot(
const BaseVehicle *v)
163 return GetCmdSendToDepot(v->
type);