(svn r10668) [NewGRF_ports] -Change: Modified IsHangar(tile) to access the TileIndexDiffC hangar lists directly. This allows portFSM to no longer be an AirportFTAClass in the future, so long as it also contains a TileIndexDiffC list of the hangar locations. NewGRF_ports
authorrichk
Mon, 23 Jul 2007 22:39:24 +0000
branchNewGRF_ports
changeset 6736 72a36d4a65ff
parent 6735 bc0cd4cfe607
child 6737 2b971fcc9a08
(svn r10668) [NewGRF_ports] -Change: Modified IsHangar(tile) to access the TileIndexDiffC hangar lists directly. This allows portFSM to no longer be an AirportFTAClass in the future, so long as it also contains a TileIndexDiffC list of the hangar locations.
src/station_map.h
--- a/src/station_map.h	Mon Jul 23 22:22:53 2007 +0000
+++ b/src/station_map.h	Mon Jul 23 22:39:24 2007 +0000
@@ -92,14 +92,17 @@
 static inline bool IsHangar(TileIndex t)
 {
 	Station *st = GetStationByTile(t);
-	AirportFTAClass *apc;
+	TileIndexDiffC *hangar_list;
+	byte num_depots;
 	if (IsCustomFSMportsSpecIndex(t)) {
-		apc = st->fsmportsspeclist[1].spec->portFSM;
+		hangar_list = st->fsmportsspeclist[1].spec->portFSM->airport_depots;
+		num_depots = st->fsmportsspeclist[1].spec->portFSM->nof_depots;
 	} else {
-		apc = st->Airport();
+		hangar_list = st->Airport()->airport_depots;
+		num_depots = st->Airport()->nof_depots;
 	}
-	for (uint i = 0; i < apc->nof_depots; i++) {
-		if (st->airport_tile + ToTileIndexDiff(apc->airport_depots[i]) == t) {
+	for (uint i = 0; i < num_depots; i++) {
+		if (st->airport_tile + ToTileIndexDiff(hangar_list[i]) == t) {
 			return true;
 		}
 	}