(svn r18857) -Codechange: don't rely on the fact that all airports are rectangular
This commit is contained in:
@@ -2066,7 +2066,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||
int w = as->size_x;
|
||||
int h = as->size_y;
|
||||
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION, w * h * _price[PR_CLEAR_STATION_AIRPORT]);
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION);
|
||||
|
||||
const Aircraft *a;
|
||||
FOR_ALL_AIRCRAFT(a) {
|
||||
@@ -2077,6 +2077,10 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||
TILE_LOOP(tile_cur, w, h, tile) {
|
||||
if (!EnsureNoVehicleOnGround(tile_cur)) return CMD_ERROR;
|
||||
|
||||
if (!st->TileBelongsToAirport(tile_cur)) continue;
|
||||
|
||||
cost.AddCost(_price[PR_CLEAR_STATION_AIRPORT]);
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
DeleteAnimatedTile(tile_cur);
|
||||
DoClearSquare(tile_cur);
|
||||
|
Reference in New Issue
Block a user