summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-04-24 18:17:53 +0000
committerbelugas <belugas@openttd.org>2008-04-24 18:17:53 +0000
commit249ea61c7e952e816cb4d44a3a9a047604828888 (patch)
tree2d9044e2713d839a8d1d97f7f3a6c82996745ec4
parent4016d15bc7c96c41ce2b701757b1145cb52bb1a3 (diff)
downloadopenttd-249ea61c7e952e816cb4d44a3a9a047604828888.tar.xz
(svn r12874) -Codechange: The closest town is already known. Do not search for it again.
-rw-r--r--src/station_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index a57e0a1e5..4261425ac 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1714,7 +1714,7 @@ CommandCost CmdBuildAirport(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
st = new Station();
- st->town = ClosestTownFromTile(tile, (uint)-1);
+ st->town = t;
GenerateStationName(st, tile, !(afc->flags & AirportFTAClass::AIRPLANES) ? STATIONNAMING_HELIPORT : STATIONNAMING_AIRPORT);
if (IsValidPlayer(_current_player)) {