(svn r24127) -Feature [FS#1497]: Allow closing airports for incoming aircraft. (Based on patch by cirdan)

This commit is contained in:
michi_cc
2012-04-17 19:43:18 +00:00
parent af6a33bd1c
commit aa47d6c7f2
16 changed files with 126 additions and 12 deletions

View File

@@ -127,3 +127,19 @@
return ::Station::Get(station_id)->town->index;
}
/*static */ bool ScriptStation::IsAirportClosed(StationID station_id)
{
EnforcePrecondition(false, IsValidStation(station_id));
EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT));
return (::Station::Get(station_id)->airport.flags & AIRPORT_CLOSED_block) != 0;
}
/*static */ bool ScriptStation::OpenCloseAirport(StationID station_id)
{
EnforcePrecondition(false, IsValidStation(station_id));
EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT));
return ScriptObject::DoCommand(0, station_id, 0, CMD_OPEN_CLOSE_AIRPORT);
}