From 67506e3781c0c1a19eeac875e87868e1905d3499 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 27 Oct 2020 17:36:53 +0000 Subject: [PATCH] Return error when upgrading airport to an identical configuration See: #200 --- src/station_cmd.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index cbf533cdec..307deedf98 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2467,6 +2467,10 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT); } + if (action == AIRPORT_UPGRADE && airport_type == st->airport.type && layout == st->airport.layout && st->airport.tile == tile) { + return_cmd_error(STR_ERROR_ALREADY_BUILT); + } + /* The noise level is the noise from the airport and reduce it to account for the distance to the town center. */ uint dist; Town *nearest = AirportGetNearestTown(as, iter, dist);