Changeset - r9383:4eb453b0ce1c
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-05-27 18:20:14
smatz@openttd.org
(svn r13293) -Fix (r13226): airport far from a town generated too much noise
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1685,17 +1685,17 @@ uint8 GetAirportNoiseLevelForTown(const 
 

	
 
	/* The airport is in the "inner" distance where there is no noise reduction */
 
	if (distance < town_tolerance_distance) return afc->noise_level;
 

	
 
	/* now, we want to have the distance segmented using the distance judged bareable by town
 
	 * This will give us the coefficient of reduction the distance provides. */
 
	uint noise_reduction = min(afc->noise_level, distance / town_tolerance_distance);
 

	
 
	/* If the noise reduction equals the airport noise itself, don't give it for free. Use it all minus 1.
 
	uint noise_reduction = distance / town_tolerance_distance;
 

	
 
	/* If the noise reduction equals the airport noise itself, don't give it for free.
 
	 * Otherwise, simply reduce the airport's level. */
 
	return max(1U, noise_reduction == afc->noise_level ? afc->noise_level - 1 : afc->noise_level - noise_reduction);
 
	return noise_reduction >= afc->noise_level ? 1 : afc->noise_level - noise_reduction;
 
}
 

	
 
/** Place an Airport.
 
 * @param tile tile where airport will be built
 
 * @param flags operation to perform
 
 * @param p1 airport type, @see airport.h
0 comments (0 inline, 0 general)