108 |
108 |
109 /* Calculate the radius of the station. Basicly it is the biggest |
109 /* Calculate the radius of the station. Basicly it is the biggest |
110 * radius that is available within the station */ |
110 * radius that is available within the station */ |
111 static uint FindCatchmentRadius(const Station* st) |
111 static uint FindCatchmentRadius(const Station* st) |
112 { |
112 { |
113 CatchmentAera ret = CA_NONE; |
113 uint ret = CA_NONE; |
114 |
114 |
115 if (st->bus_stops != NULL) ret = max(ret, CA_BUS); |
115 if (st->bus_stops != NULL) ret = max<uint>(ret, CA_BUS); |
116 if (st->truck_stops != NULL) ret = max(ret, CA_TRUCK); |
116 if (st->truck_stops != NULL) ret = max<uint>(ret, CA_TRUCK); |
117 if (st->train_tile) ret = max(ret, CA_TRAIN); |
117 if (st->train_tile != 0) ret = max<uint>(ret, CA_TRAIN); |
118 if (st->dock_tile) ret = max(ret, CA_DOCK); |
118 if (st->dock_tile != 0) ret = max<uint>(ret, CA_DOCK); |
119 |
119 if (st->airport_tile) ret = max<uint>(ret, st->Airport()->catchment); |
120 if (st->airport_tile) { |
|
121 switch (st->airport_type) { |
|
122 case AT_OILRIG: ret = max(ret, CA_AIR_OILPAD); break; |
|
123 case AT_SMALL: ret = max(ret, CA_AIR_SMALL); break; |
|
124 case AT_HELIPORT: ret = max(ret, CA_AIR_HELIPORT); break; |
|
125 case AT_LARGE: ret = max(ret, CA_AIR_LARGE); break; |
|
126 case AT_METROPOLITAN: ret = max(ret, CA_AIR_METRO); break; |
|
127 case AT_INTERNATIONAL: ret = max(ret, CA_AIR_INTER); break; |
|
128 case AT_COMMUTER: ret = max(ret, CA_AIR_COMMUTER); break; |
|
129 case AT_HELIDEPOT: ret = max(ret, CA_AIR_HELIDEPOT); break; |
|
130 case AT_INTERCON: ret = max(ret, CA_AIR_INTERCON); break; |
|
131 case AT_HELISTATION: ret = max(ret, CA_AIR_HELISTATION); break; |
|
132 } |
|
133 } |
|
134 |
120 |
135 return ret; |
121 return ret; |
136 } |
122 } |
137 |
123 |
138 #define CHECK_STATIONS_ERR ((Station*)-1) |
124 #define CHECK_STATIONS_ERR ((Station*)-1) |