static */
| 129 | |
| 130 | |
| 131 | /* static */ SQInteger ScriptAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type) |
| 132 | { |
| 133 | if (!::IsValidTile(tile)) return -1; |
| 134 | if (!IsAirportInformationAvailable(type)) return -1; |
| 135 | |
| 136 | const AirportSpec *as = ::AirportSpec::Get(type); |
| 137 | if (!as->IsWithinMapBounds(0, tile)) return -1; |
| 138 | |
| 139 | if (_settings_game.economy.station_noise_level) { |
| 140 | uint dist; |
| 141 | const auto &layout = as->layouts[0]; |
| 142 | AirportGetNearestTown(as, layout.rotation, tile, AirportTileTableIterator(layout.tiles, tile), dist); |
| 143 | return GetAirportNoiseLevelForDistance(as, dist); |
| 144 | } |
| 145 | |
| 146 | return 1; |
| 147 | } |
| 148 | |
| 149 | /* static */ TownID ScriptAirport::GetNearestTown(TileIndex tile, AirportType type) |
| 150 | { |
nothing calls this directly
no test coverage detected