From 72857162ddee0df447758c4261c0c5d3ce7669c3 Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 17 Feb 2007 07:45:18 +0000 Subject: (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 --- src/station_cmd.cpp | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/station_cmd.cpp') diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 425fb49f0..efb08d91f 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -110,27 +110,13 @@ static uint GetNumRoadStopsInStation(const Station* st, RoadStop::Type type) * radius that is available within the station */ static uint FindCatchmentRadius(const Station* st) { - CatchmentAera ret = CA_NONE; - - if (st->bus_stops != NULL) ret = max(ret, CA_BUS); - if (st->truck_stops != NULL) ret = max(ret, CA_TRUCK); - if (st->train_tile) ret = max(ret, CA_TRAIN); - if (st->dock_tile) ret = max(ret, CA_DOCK); - - if (st->airport_tile) { - switch (st->airport_type) { - case AT_OILRIG: ret = max(ret, CA_AIR_OILPAD); break; - case AT_SMALL: ret = max(ret, CA_AIR_SMALL); break; - case AT_HELIPORT: ret = max(ret, CA_AIR_HELIPORT); break; - case AT_LARGE: ret = max(ret, CA_AIR_LARGE); break; - case AT_METROPOLITAN: ret = max(ret, CA_AIR_METRO); break; - case AT_INTERNATIONAL: ret = max(ret, CA_AIR_INTER); break; - case AT_COMMUTER: ret = max(ret, CA_AIR_COMMUTER); break; - case AT_HELIDEPOT: ret = max(ret, CA_AIR_HELIDEPOT); break; - case AT_INTERCON: ret = max(ret, CA_AIR_INTERCON); break; - case AT_HELISTATION: ret = max(ret, CA_AIR_HELISTATION); break; - } - } + uint ret = CA_NONE; + + if (st->bus_stops != NULL) ret = max(ret, CA_BUS); + if (st->truck_stops != NULL) ret = max(ret, CA_TRUCK); + if (st->train_tile != 0) ret = max(ret, CA_TRAIN); + if (st->dock_tile != 0) ret = max(ret, CA_DOCK); + if (st->airport_tile) ret = max(ret, st->Airport()->catchment); return ret; } -- cgit v1.2.3-70-g09d2