* Check whether the given tile is a hangar. * @param t the tile to of whether it is a hangar. * @pre IsTileType(t, MP_STATION) * @return true if and only if the tile is a hangar. */
| 95 | * @return true if and only if the tile is a hangar. |
| 96 | */ |
| 97 | bool IsHangar(Tile t) |
| 98 | { |
| 99 | assert(IsTileType(t, MP_STATION)); |
| 100 | |
| 101 | /* If the tile isn't an airport there's no chance it's a hangar. */ |
| 102 | if (!IsAirport(t)) return false; |
| 103 | |
| 104 | const Station *st = Station::GetByTile(t); |
| 105 | const AirportSpec *as = st->airport.GetSpec(); |
| 106 | |
| 107 | for (const auto &depot : as->depots) { |
| 108 | if (st->airport.GetRotatedTileFromOffset(depot.ti) == TileIndex(t)) return true; |
| 109 | } |
| 110 | |
| 111 | return false; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Look for a station owned by the given company around the given tile area. |
no test coverage detected