summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-06 21:02:57 +0000
committerrubidium <rubidium@openttd.org>2011-12-06 21:02:57 +0000
commitde46e9647bc2bc4a31b181849a93b420db8b8c58 (patch)
tree3bc97abb352356d53549f88833edea80fb66305b /src/script/api
parentc0a6ce302555f189509ca0300c1377ce552c608e (diff)
downloadopenttd-de46e9647bc2bc4a31b181849a93b420db8b8c58.tar.xz
(svn r23441) -Fix [FS#4764]: some airport functions didn't take the layout into account resulting in wrong noise levels or nearests towns (patch by Zuu)
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/script_airport.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/api/script_airport.cpp b/src/script/api/script_airport.cpp
index a1364d7af..d040d3094 100644
--- a/src/script/api/script_airport.cpp
+++ b/src/script/api/script_airport.cpp
@@ -127,16 +127,16 @@
/* static */ int ScriptAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type)
{
- extern Town *AirportGetNearestTown(const AirportSpec *as, TileIndex airport_tile);
- extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, TileIndex town_tile, TileIndex tile);
+ extern Town *AirportGetNearestTown(const AirportSpec *as, byte layout, TileIndex airport_tile);
+ extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, byte layout, TileIndex town_tile, TileIndex tile);
if (!::IsValidTile(tile)) return -1;
if (!IsAirportInformationAvailable(type)) return -1;
if (_settings_game.economy.station_noise_level) {
const AirportSpec *as = ::AirportSpec::Get(type);
- const Town *t = AirportGetNearestTown(as, tile);
- return GetAirportNoiseLevelForTown(as, t->xy, tile);
+ const Town *t = AirportGetNearestTown(as, 0, tile);
+ return GetAirportNoiseLevelForTown(as, 0, t->xy, tile);
}
return 1;
@@ -144,12 +144,12 @@
/* static */ TownID ScriptAirport::GetNearestTown(TileIndex tile, AirportType type)
{
- extern Town *AirportGetNearestTown(const AirportSpec *as, TileIndex airport_tile);
+ extern Town *AirportGetNearestTown(const AirportSpec *as, byte layout, TileIndex airport_tile);
if (!::IsValidTile(tile)) return INVALID_TOWN;
if (!IsAirportInformationAvailable(type)) return INVALID_TOWN;
- return AirportGetNearestTown(AirportSpec::Get(type), tile)->index;
+ return AirportGetNearestTown(AirportSpec::Get(type), 0, tile)->index;
}
/* static */ uint16 ScriptAirport::GetMaintenanceCostFactor(AirportType type)