summaryrefslogtreecommitdiff
path: root/src/ai/default
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-17 07:45:18 +0000
committertron <tron@openttd.org>2007-02-17 07:45:18 +0000
commit8aacd2585d0992dc3a87da8042369bb1830d8cd5 (patch)
treecdfedf5d3384be14d0978c46e2c599f6c1265392 /src/ai/default
parentee0739561d0ee2167f769ff0abca6302ce270581 (diff)
downloadopenttd-8aacd2585d0992dc3a87da8042369bb1830d8cd5.tar.xz
(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
Diffstat (limited to 'src/ai/default')
-rw-r--r--src/ai/default/default.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 33f62c7f2..f8af9c333 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -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);