summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-19 11:17:52 +0000
committeryexo <yexo@openttd.org>2010-03-19 11:17:52 +0000
commit1579e9ded29b89678e4c56ac82b6907537a920a7 (patch)
treec043257beec5af4474692a648fcc16b39d33c4d2 /src/ai
parentf2743cd5ed72a2d6224ffa828aab796ed771cef2 (diff)
downloadopenttd-1579e9ded29b89678e4c56ac82b6907537a920a7.tar.xz
(svn r19465) -Codechange: support for multi-tile hangars
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_airport.cpp2
-rw-r--r--src/ai/api/ai_depotlist.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/ai/api/ai_airport.cpp b/src/ai/api/ai_airport.cpp
index 13b62ce43..fb6fbbd71 100644
--- a/src/ai/api/ai_airport.cpp
+++ b/src/ai/api/ai_airport.cpp
@@ -96,7 +96,7 @@
if (st->owner != _current_company) return -1;
if ((st->facilities & FACIL_AIRPORT) == 0) return -1;
- return st->airport.GetSpec()->nof_depots;
+ return st->airport.GetNumHangars();
}
/* static */ TileIndex AIAirport::GetHangarOfAirport(TileIndex tile)
diff --git a/src/ai/api/ai_depotlist.cpp b/src/ai/api/ai_depotlist.cpp
index bade09bcd..de3433834 100644
--- a/src/ai/api/ai_depotlist.cpp
+++ b/src/ai/api/ai_depotlist.cpp
@@ -29,8 +29,7 @@ AIDepotList::AIDepotList(AITile::TransportType transport_type)
const Station *st;
FOR_ALL_STATIONS(st) {
if (st->owner == ::_current_company) {
- const AirportSpec *as = st->airport.GetSpec();
- for (uint i = 0; i < as->nof_depots; i++) {
+ for (uint i = 0; i < st->airport.GetNumHangars(); i++) {
this->AddItem(st->airport.GetHangarTile(i));
}
}