* Retrieve airport spec for the given airport. If an override is available * it is returned. * @param type index of airport * @return A pointer to the corresponding AirportSpec */ static */
| 57 | * @return A pointer to the corresponding AirportSpec |
| 58 | */ |
| 59 | /* static */ const AirportSpec *AirportSpec::Get(uint8_t type) |
| 60 | { |
| 61 | assert(type < lengthof(AirportSpec::specs)); |
| 62 | const AirportSpec *as = &AirportSpec::specs[type]; |
| 63 | if (type >= NEW_AIRPORT_OFFSET && !as->enabled) { |
| 64 | if (_airport_mngr.GetGRFID(type) == 0) return as; |
| 65 | uint8_t subst_id = _airport_mngr.GetSubstituteID(type); |
| 66 | if (subst_id == AT_INVALID) return as; |
| 67 | as = &AirportSpec::specs[subst_id]; |
| 68 | } |
| 69 | if (as->grf_prop.override_id != AT_INVALID) return &AirportSpec::specs[as->grf_prop.override_id]; |
| 70 | return as; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Retrieve airport spec for the given airport. Even if an override is |
nothing calls this directly
no test coverage detected