Changeset - r9855:7cff0ec982fd
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-08-04 22:31:49
rubidium@openttd.org
(svn r13999) -Fix [FS#2190]: crash when the AI tries to find the depot of an airport that doesn't have a depot.
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/ai/default/default.cpp
Show inline comments
 
@@ -3571,12 +3571,13 @@ static void AiStateBuildAircraftVehicles
 
		if (!(flags & AirportFTAClass::AIRPLANES)) forbidden |= AIR_CTOL | AIR_FAST; // no planes for heliports / oil rigs
 
		if (flags & AirportFTAClass::SHORT_STRIP) forbidden |= AIR_FAST; // no fast planes for small airports
 
	}
 

	
 
	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 */
 
	tile += ToTileIndexDiff(GetStationByTile(tile)->Airport()->airport_depots[0]);
 
	if (CmdFailed(DoCommand(tile, veh, 0, DC_EXEC, CMD_BUILD_AIRCRAFT))) return;
 
	loco_id = _new_vehicle_id;
0 comments (0 inline, 0 general)