summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-02-02 15:45:53 +0000
committertron <tron@openttd.org>2005-02-02 15:45:53 +0000
commitc51ed8465d1726d554068ffd9cc278ea50e8e223 (patch)
tree13762dc78ac7f59344ec0a7ab38a01ae4d3e4942
parent2e357e69f923a719c2a62363436a716223029269 (diff)
downloadopenttd-c51ed8465d1726d554068ffd9cc278ea50e8e223.tar.xz
(svn r1769) Don't compute the same value twice, remove one function call
-rw-r--r--station_cmd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 98fe79fe6..f4a4fc8aa 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1670,15 +1670,13 @@ int32 CmdBuildAirport(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (st->airport_tile != 0)
return_cmd_error(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT);
} else {
- Town *t;
-
airport_upgrade = false;
st = AllocateStation();
if (st == NULL)
return CMD_ERROR;
- st->town = t = ClosestTownFromTile(tile, (uint)-1);
+ st->town = t;
if (_current_player < MAX_PLAYERS && flags&DC_EXEC)
SETBIT(t->have_ratings, _current_player);