summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-10 08:19:39 +0000
committertron <tron@openttd.org>2007-02-10 08:19:39 +0000
commit356e47f1087b56244694a646eb73ee6c9264a229 (patch)
treee8a4f43e2fa50f6e1637a184752b1ce7c9f43a9c /src/ai
parentb4592c8a542c06f4509402ebac846a44775740c9 (diff)
downloadopenttd-356e47f1087b56244694a646eb73ee6c9264a229.tar.xz
(svn r8660) -Fix
-Codechange: Remove _avail_aircraft Its name is misleading. It is rather _avail_airports, but then only some of them, which leads to inconsistencies when using it. Further it is unnecessary to store it in savegams.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/default/default.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 0d43ff11f..f1e8063bf 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3323,10 +3323,11 @@ static void AiStateAirportStuff(Player *p)
static int32 AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultBlockData *p, byte flag)
{
+ uint32 avail_airports = GetValidAirports();
int32 total_cost = 0, ret;
for (; p->mode == 0; p++) {
- if (!HASBIT(_avail_aircraft, p->attr)) return CMD_ERROR;
+ if (!HASBIT(avail_airports, p->attr)) return CMD_ERROR;
ret = DoCommand(TILE_MASK(tile + ToTileIndexDiff(p->tileoffs)), p->attr,0,flag | DC_AUTO | DC_NO_WATER,CMD_BUILD_AIRPORT);
if (CmdFailed(ret)) return CMD_ERROR;
total_cost += ret;