Changeset - r12304:0c02bc720761
[Not reviewed]
master
0 1 0
yexo - 15 years ago 2009-07-03 19:55:07
yexo@openttd.org
(svn r16731) -Fix [NoAI]: AIDepotList contained wrong tiles for hangars when st->xy != st->airport_tile.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_depotlist.cpp
Show inline comments
 
@@ -16,25 +16,25 @@ AIDepotList::AIDepotList(AITile::Transpo
 

	
 
		case AITile::TRANSPORT_ROAD:  tile_type = ::MP_ROAD; break;
 
		case AITile::TRANSPORT_RAIL:  tile_type = ::MP_RAILWAY; break;
 
		case AITile::TRANSPORT_WATER: tile_type = ::MP_WATER; break;
 

	
 
		case AITile::TRANSPORT_AIR: {
 
			/* Hangars are not seen as real depots by the depot code. */
 
			const Station *st;
 
			FOR_ALL_STATIONS(st) {
 
				if (st->owner == ::_current_company) {
 
					const AirportFTAClass *afc = st->Airport();
 
					for (uint i = 0; i < afc->nof_depots; i++) {
 
						this->AddItem(st->xy + ToTileIndexDiff(afc->airport_depots[i]));
 
						this->AddItem(st->airport_tile + ToTileIndexDiff(afc->airport_depots[i]));
 
					}
 
				}
 
			}
 
			return;
 
		}
 
	}
 

	
 
	/* Handle 'standard' depots. */
 
	const Depot *depot;
 
	FOR_ALL_DEPOTS(depot) {
 
		if (::GetTileOwner(depot->xy) == ::_current_company && ::IsTileType(depot->xy, tile_type)) this->AddItem(depot->xy);
 
	}
0 comments (0 inline, 0 general)