changeset 9855:a3916adebd9a draft

(svn r13999) -Fix [FS#2190]: crash when the AI tries to find the depot of an airport that doesn't have a depot.
author rubidium <rubidium@openttd.org>
date Mon, 04 Aug 2008 22:31:49 +0000
parents d7ed2065524c
children 706f058d13e0
files src/ai/default/default.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3574,6 +3574,7 @@
 
 	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 */