Fix 35d2842d: Fix script handling of airport rotations
				
					
				
			Adjust types/signature
This commit is contained in:
		@@ -141,7 +141,7 @@ extern uint8 GetAirportNoiseLevelForDistance(const struct AirportSpec *as, uint
 | 
			
		||||
 | 
			
		||||
	if (_settings_game.economy.station_noise_level) {
 | 
			
		||||
		uint dist;
 | 
			
		||||
		AirportGetNearestTown(as, DIR_N, tile, AirportTileTableIterator(as->table[0], tile), dist);
 | 
			
		||||
		AirportGetNearestTown(as, as->rotation[0], tile, AirportTileTableIterator(as->table[0], tile), dist);
 | 
			
		||||
		return GetAirportNoiseLevelForDistance(as, dist);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -157,7 +157,7 @@ extern uint8 GetAirportNoiseLevelForDistance(const struct AirportSpec *as, uint
 | 
			
		||||
	if (!as->IsWithinMapBounds(0, tile)) return INVALID_TOWN;
 | 
			
		||||
 | 
			
		||||
	uint dist;
 | 
			
		||||
	return AirportGetNearestTown(as, DIR_N, tile, AirportTileTableIterator(as->table[0], tile), dist)->index;
 | 
			
		||||
	return AirportGetNearestTown(as, as->rotation[0], tile, AirportTileTableIterator(as->table[0], tile), dist)->index;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* static */ SQInteger ScriptAirport::GetMaintenanceCostFactor(AirportType type)
 | 
			
		||||
 
 | 
			
		||||
@@ -2611,8 +2611,8 @@ Town *AirportGetNearestTown(const AirportSpec *as, Direction rotation, TileIndex
 | 
			
		||||
 | 
			
		||||
	Town *nearest = nullptr;
 | 
			
		||||
 | 
			
		||||
	int width = as->size_x;
 | 
			
		||||
	int height = as->size_y;
 | 
			
		||||
	auto width = as->size_x;
 | 
			
		||||
	auto height = as->size_y;
 | 
			
		||||
	if (rotation == DIR_E || rotation == DIR_W) std::swap(width, height);
 | 
			
		||||
 | 
			
		||||
	uint perimeter_min_x = TileX(tile);
 | 
			
		||||
@@ -2648,7 +2648,7 @@ Town *AirportGetNearestTown(const AirportSpec *as, Direction rotation, TileIndex
 | 
			
		||||
 * @param[out] mindist Minimum distance to town
 | 
			
		||||
 * @return nearest town to airport
 | 
			
		||||
 */
 | 
			
		||||
Town *AirportGetNearestTown(const Station *st, uint &mindist)
 | 
			
		||||
static Town *AirportGetNearestTown(const Station *st, uint &mindist)
 | 
			
		||||
{
 | 
			
		||||
	return AirportGetNearestTown(st->airport.GetSpec(), st->airport.rotation, st->airport.tile, AirportTileIterator(st), mindist);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user