(svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.

This commit is contained in:
peter1138
2006-03-31 12:59:43 +00:00
parent 859fc1d7f0
commit cd0a67dc65
5 changed files with 14 additions and 8 deletions

View File

@@ -219,6 +219,12 @@ extern ShipVehicleInfo _ship_vehicle_info[NUM_SHIP_ENGINES];
extern AircraftVehicleInfo _aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
extern RoadVehicleInfo _road_vehicle_info[NUM_ROAD_ENGINES];
static inline const EngineInfo *EngInfo(EngineID e)
{
assert(e < lengthof(_engine_info));
return &_engine_info[e];
}
static inline const RailVehicleInfo* RailVehInfo(EngineID e)
{
assert(e < lengthof(_rail_vehicle_info));