(svn r8767) -Fix

-Codechange: Do not hardcode the catchment radius of airports, but hold the information in AirportFTAClass
-Fix (r979): The default AI tested possible airport locations with a fixed catchment radius instead of the radius of the to be built airport
This commit is contained in:
tron
2007-02-17 07:45:18 +00:00
parent ee0739561d
commit 8aacd2585d
6 changed files with 36 additions and 66 deletions

View File

@@ -3333,19 +3333,13 @@ static int32 AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultBlockDa
static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p, byte cargo)
{
uint values[NUM_CARGO];
int rad;
if (_patches.modified_catchment) {
rad = CA_AIR_LARGE; // I Have NFI what airport the
} else { // AI is going to build here
rad = 4;
}
for (; p->mode == 0; p++) {
TileIndex tile2 = TILE_ADD(tile, ToTileIndexDiff(p->tileoffs));
const AirportFTAClass* airport = GetAirport(p->attr);
uint w = airport->size_x;
uint h = airport->size_y;
uint rad = _patches.modified_catchment ? airport->catchment : 4;
if (cargo & 0x80) {
GetProductionAroundTiles(values, tile2, w, h, rad);