summaryrefslogtreecommitdiff
path: root/airport.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-12-18 12:19:04 +0000
committertron <tron@openttd.org>2004-12-18 12:19:04 +0000
commit376c5adb7ce86c3179dc38151c0ef15ef6f4f723 (patch)
tree6a21be6023198b75c0e6ac1463e0798005629948 /airport.c
parent64f98e058d8f54a23645614b09287f059893b9ab (diff)
downloadopenttd-376c5adb7ce86c3179dc38151c0ef15ef6f4f723.tar.xz
(svn r1149) Fix hack which abuses first TileIndex of airport depot array as number of depots (similar change as in map branch)
Diffstat (limited to 'airport.c')
-rw-r--r--airport.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/airport.c b/airport.c
index 7b6c96276..96d2473be 100644
--- a/airport.c
+++ b/airport.c
@@ -14,7 +14,7 @@ static void AirportFTAClass_Constructor(AirportFTAClass *Airport,
const byte nofhelipads, const byte nofhelipadgroups,
const byte entry_point, const byte acc_planes,
const AirportFTAbuildup *FA,
- const TileIndex *depots);
+ const TileIndex *depots, const byte nof_depots);
static void AirportFTAClass_Destructor(AirportFTAClass *Airport);
static uint16 AirportGetNofElements(const AirportFTAbuildup *FA);
@@ -27,23 +27,23 @@ void InitializeAirports()
{
// country airport
CountryAirport = (AirportFTAClass *)malloc(sizeof(AirportFTAClass));
- AirportFTAClass_Constructor(CountryAirport, 2, 1, 0, 0, 16, ALL, _airport_fta_country, _airport_depots_country);
+ AirportFTAClass_Constructor(CountryAirport, 2, 1, 0, 0, 16, ALL, _airport_fta_country, _airport_depots_country, lengthof(_airport_depots_country));
// city airport
CityAirport = (AirportFTAClass *)malloc(sizeof(AirportFTAClass));
- AirportFTAClass_Constructor(CityAirport, 3, 1, 0, 0, 19, ALL, _airport_fta_city, _airport_depots_city);
+ AirportFTAClass_Constructor(CityAirport, 3, 1, 0, 0, 19, ALL, _airport_fta_city, _airport_depots_city, lengthof(_airport_depots_city));
// metropolitan airport
MetropolitanAirport = (AirportFTAClass *)malloc(sizeof(AirportFTAClass));
- AirportFTAClass_Constructor(MetropolitanAirport, 3, 1, 0, 0, 20, ALL, _airport_fta_metropolitan, _airport_depots_metropolitan);
+ AirportFTAClass_Constructor(MetropolitanAirport, 3, 1, 0, 0, 20, ALL, _airport_fta_metropolitan, _airport_depots_metropolitan, lengthof(_airport_depots_metropolitan));
// international airport
InternationalAirport = (AirportFTAClass *)malloc(sizeof(AirportFTAClass));
- AirportFTAClass_Constructor(InternationalAirport, 6, 2, 2, 1, 37, ALL, _airport_fta_international, _airport_depots_international);
+ AirportFTAClass_Constructor(InternationalAirport, 6, 2, 2, 1, 37, ALL, _airport_fta_international, _airport_depots_international, lengthof(_airport_depots_international));
// heliport, oilrig
Heliport = (AirportFTAClass *)malloc(sizeof(AirportFTAClass));
- AirportFTAClass_Constructor(Heliport, 0, 0, 1, 1, 7, HELICOPTERS_ONLY, _airport_fta_heliport_oilrig, _airport_depots_heliport_oilrig);
+ AirportFTAClass_Constructor(Heliport, 0, 0, 1, 1, 7, HELICOPTERS_ONLY, _airport_fta_heliport_oilrig, NULL, 0);
Oilrig = Heliport; // exactly the same structure for heliport/oilrig, so share state machine
}
@@ -61,7 +61,7 @@ static void AirportFTAClass_Constructor(AirportFTAClass *Airport,
const byte nofhelipads, const byte nofhelipadgroups,
const byte entry_point, const byte acc_planes,
const AirportFTAbuildup *FA,
- const TileIndex *depots)
+ const TileIndex *depots, const byte nof_depots)
{
// if there are more terminals than 6, internal variables have to be changed, so don't allow that
// same goes for helipads
@@ -89,7 +89,8 @@ static void AirportFTAClass_Constructor(AirportFTAClass *Airport,
Airport->nofhelipadgroups = nofhelipadgroups;
Airport->acc_planes = acc_planes;
Airport->entry_point = entry_point;
- Airport->airport_depots = (const uint16*)depots;
+ Airport->airport_depots = depots;
+ Airport->nof_depots = nof_depots;
// build the state machine