changeset 9383:4274026b9c21 draft

(svn r13293) -Fix (r13226): airport far from a town generated too much noise
author smatz <smatz@openttd.org>
date Tue, 27 May 2008 18:20:14 +0000
parents 6d8ee9e0b359
children d4b97b15782c
files src/station_cmd.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1688,11 +1688,11 @@
 
 	/* 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.