File diff r9330:478a38d542ef → r9331:c880f7d4ef98
src/ai/default/default.cpp
Show inline comments
 
@@ -3437,25 +3437,26 @@ static bool AiCheckAirportResources(Tile
 
}
 

	
 
static int AiFindBestDefaultAirportBlock(TileIndex tile, byte cargo, byte heli, CommandCost *cost)
 
{
 
	const AiDefaultBlockData *p;
 

	
 
	bool no_small = false;
 

	
 
	if (!heli) {
 
		/* do not build small airport if we have large available and we are not building heli route */
 
		uint valid = GetValidAirports();
 
		for (uint i = 0; (p = _airport_default_block_data[i]) != NULL; i++) {
 
			if (HasBit(valid, p->attr) && !(GetAirport(p->attr)->flags & AirportFTAClass::SHORT_STRIP)) {
 
			uint flags = GetAirport(p->attr)->flags;
 
			if (HasBit(valid, p->attr) && (flags & AirportFTAClass::AIRPLANES) && !(flags & AirportFTAClass::SHORT_STRIP)) {
 
				no_small = true;
 
				break;
 
			}
 
		}
 
	}
 

	
 
	for (uint i = 0; (p = _airport_default_block_data[i]) != NULL; i++) {
 
		uint flags = GetAirport(p->attr)->flags;
 
		/* If we are doing a helicopter service, avoid building airports where they can't land */
 
		if (heli && !(flags & AirportFTAClass::HELICOPTERS)) continue;
 
		/* Similiar with aircraft ... */
 
		if (!heli && !(flags & AirportFTAClass::AIRPLANES)) continue;