src/ai/default/default.cpp
changeset 6041 bba4112e5daa
parent 6032 fe6a454ac1ba
child 6106 2898cd9417fd
equal deleted inserted replaced
6040:95729a9673ce 6041:bba4112e5daa
  3331 }
  3331 }
  3332 
  3332 
  3333 static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
  3333 static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
  3334 {
  3334 {
  3335 	uint values[NUM_CARGO];
  3335 	uint values[NUM_CARGO];
  3336 	int rad;
       
  3337 
       
  3338 	if (_patches.modified_catchment) {
       
  3339 		rad = CA_AIR_LARGE; // I Have NFI what airport the
       
  3340 	} else { // AI is going to build here
       
  3341 		rad = 4;
       
  3342 	}
       
  3343 
  3336 
  3344 	for (; p->mode == 0; p++) {
  3337 	for (; p->mode == 0; p++) {
  3345 		TileIndex tile2 = TILE_ADD(tile, ToTileIndexDiff(p->tileoffs));
  3338 		TileIndex tile2 = TILE_ADD(tile, ToTileIndexDiff(p->tileoffs));
  3346 		const AirportFTAClass* airport = GetAirport(p->attr);
  3339 		const AirportFTAClass* airport = GetAirport(p->attr);
  3347 		uint w = airport->size_x;
  3340 		uint w = airport->size_x;
  3348 		uint h = airport->size_y;
  3341 		uint h = airport->size_y;
       
  3342 		uint rad = _patches.modified_catchment ? airport->catchment : 4;
  3349 
  3343 
  3350 		if (cargo & 0x80) {
  3344 		if (cargo & 0x80) {
  3351 			GetProductionAroundTiles(values, tile2, w, h, rad);
  3345 			GetProductionAroundTiles(values, tile2, w, h, rad);
  3352 			return values[cargo & 0x7F] != 0;
  3346 			return values[cargo & 0x7F] != 0;
  3353 		} else {
  3347 		} else {