File diff r23953:ba75d2f3b530 → r23954:8e43140b9a66
src/aircraft_cmd.cpp
Show inline comments
 
@@ -116,13 +116,12 @@ enum HelicopterRotorStates {
 
 * airports (like helipads only)
 
 * @param v vehicle looking for a hangar
 
 * @return the StationID if one is found, otherwise, INVALID_STATION
 
 */
 
static StationID FindNearestHangar(const Aircraft *v)
 
{
 
	const Station *st;
 
	uint best = 0;
 
	StationID index = INVALID_STATION;
 
	TileIndex vtile = TileVirtXY(v->x_pos, v->y_pos);
 
	const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
 
	uint max_range = v->acache.cached_max_range_sqr;
 

	
 
@@ -137,13 +136,13 @@ static StationID FindNearestHangar(const
 
		} else {
 
			last_dest = GetTargetAirportIfValid(v);
 
			next_dest = Station::GetIfValid(v->GetNextStoppingStation().value);
 
		}
 
	}
 

	
 
	FOR_ALL_STATIONS(st) {
 
	for (const Station *st : Station::Iterate()) {
 
		if (st->owner != v->owner || !(st->facilities & FACIL_AIRPORT) || !st->airport.HasHangar()) continue;
 

	
 
		const AirportFTAClass *afc = st->airport.GetFTA();
 

	
 
		/* don't crash the plane if we know it can't land at the airport */
 
		if ((afc->flags & AirportFTAClass::SHORT_STRIP) && (avi->subtype & AIR_FAST) && !_cheats.no_jetcrash.value) continue;