(svn r15346) -Add [NoAI]: Add AIAirport::GetNearestTown() so AIs can known in which town the noise level will increase.
This commit is contained in:
@@ -125,3 +125,13 @@
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* static */ TownID AIAirport::GetNearestTown(TileIndex tile, AirportType type)
|
||||
{
|
||||
extern Town *AirportGetNearestTown(const AirportFTAClass *afc, TileIndex airport_tile);
|
||||
|
||||
if (!::IsValidTile(tile)) return INVALID_TOWN;
|
||||
if (!IsValidAirportType(type)) return INVALID_TOWN;
|
||||
|
||||
return AirportGetNearestTown(GetAirport(type), tile)->index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user