(svn r1769) Don't compute the same value twice, remove one function call

This commit is contained in:
tron 2005-02-02 15:45:53 +00:00
parent 2e357e69f9
commit c51ed8465d

View File

@ -1670,15 +1670,13 @@ int32 CmdBuildAirport(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (st->airport_tile != 0) if (st->airport_tile != 0)
return_cmd_error(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT); return_cmd_error(STR_300D_TOO_CLOSE_TO_ANOTHER_AIRPORT);
} else { } else {
Town *t;
airport_upgrade = false; airport_upgrade = false;
st = AllocateStation(); st = AllocateStation();
if (st == NULL) if (st == NULL)
return CMD_ERROR; return CMD_ERROR;
st->town = t = ClosestTownFromTile(tile, (uint)-1); st->town = t;
if (_current_player < MAX_PLAYERS && flags&DC_EXEC) if (_current_player < MAX_PLAYERS && flags&DC_EXEC)
SETBIT(t->have_ratings, _current_player); SETBIT(t->have_ratings, _current_player);