# HG changeset patch # User frosch # Date 2012-11-12 18:09:33 # Node ID 9bb654bae77cd33956b283cb4a5f4d5d6e50a203 # Parent f016c4b7709284e7f4cf93c424ff7eb7b4222505 (svn r24703) -Fix: Disallow closing oilrig airports in SE. diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2345,7 +2345,7 @@ CommandCost CmdOpenCloseAirport(TileInde if (!Station::IsValidID(p1)) return CMD_ERROR; Station *st = Station::Get(p1); - if (!(st->facilities & FACIL_AIRPORT)) return CMD_ERROR; + if (!(st->facilities & FACIL_AIRPORT) || st->owner == OWNER_NONE) return CMD_ERROR; CommandCost ret = CheckOwnership(st->owner); if (ret.Failed()) return ret; diff --git a/src/station_gui.cpp b/src/station_gui.cpp --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -877,7 +877,7 @@ struct StationViewWindow : public Window this->SetWidgetDisabledState(WID_SV_ROADVEHS, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP)); this->SetWidgetDisabledState(WID_SV_SHIPS, !(st->facilities & FACIL_DOCK)); this->SetWidgetDisabledState(WID_SV_PLANES, !(st->facilities & FACIL_AIRPORT)); - this->SetWidgetDisabledState(WID_SV_CLOSE_AIRPORT, !(st->facilities & FACIL_AIRPORT) || st->owner != _local_company); + this->SetWidgetDisabledState(WID_SV_CLOSE_AIRPORT, !(st->facilities & FACIL_AIRPORT) || st->owner != _local_company || st->owner == OWNER_NONE); // Also consider SE, where _local_company == OWNER_NONE this->SetWidgetLoweredState(WID_SV_CLOSE_AIRPORT, (st->facilities & FACIL_AIRPORT) && (st->airport.flags & AIRPORT_CLOSED_block) != 0); this->DrawWidgets();