FS#4117 - AITile.HasTrasportType does not return true for airport tiles

Attached to Project: OpenTTD
Opened by Attila7 (Attila7) - Friday, 10 September 2010, 13:20 GMT
Last edited by Thijs Marinussen (Yexo) - Monday, 13 September 2010, 13:36 GMT
Type Bug
Category Script → NoAI
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


According to the documentation, AITile.HasTransportType(tile,AITile.TRANSPORT_AIR) should return true if the tile has an airport on it. It does not.

I am not exactly sure where the bug is, but it appears that TRANSPORT_AIR needs special handling in function GetTileTrackStatus_Station in file station_cmd.cpp or the code should not end up in there in the first place.
This task depends upon

Closed by  Thijs Marinussen (Yexo)
Monday, 13 September 2010, 13:36 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Documented the behavior in r20798
Comment by Zdeněk Sojka (SmatZ) - Friday, 10 September 2010, 13:46 GMT
* @return True if and only if the tile has the given TransportType.
TRANSPORT_AIR is special in such a way that all tiles have in fact that transport type (aircraft can fly over them)
Comment by Thijs Marinussen (Yexo) - Friday, 10 September 2010, 13:57 GMT
The function isn't intended to work for airport tiles, but that fact is missing from the documentation. Use AIAirport.IsAirportTile instead.