summaryrefslogtreecommitdiff
path: root/src/ai/default/default.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-04 22:31:49 +0000
committerrubidium <rubidium@openttd.org>2008-08-04 22:31:49 +0000
commitfe6111d6f22112f4979becc7d287ea5b3aa73b11 (patch)
tree61100aaecdf70d7ff5ef9596eccc9eff77eb749f /src/ai/default/default.cpp
parent8025cd1d2c678de3c343deaf4ccd6a9af45ef138 (diff)
downloadopenttd-fe6111d6f22112f4979becc7d287ea5b3aa73b11.tar.xz
(svn r13999) -Fix [FS#2190]: crash when the AI tries to find the depot of an airport that doesn't have a depot.
Diffstat (limited to 'src/ai/default/default.cpp')
-rw-r--r--src/ai/default/default.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index db91cdab3..772ef87c3 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3574,6 +3574,7 @@ static void AiStateBuildAircraftVehicles(Player *p)
veh = AiChooseAircraftToBuild(p->player_money, forbidden);
if (veh == INVALID_ENGINE) return;
+ if (GetStationByTile(tile)->Airport()->nof_depots == 0) return;
/* XXX - Have the AI pick the hangar terminal in an airport. Eg get airport-type
* and offset to the FIRST depot because the AI picks the st->xy tile */