summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-05-27 18:20:14 +0000
committersmatz <smatz@openttd.org>2008-05-27 18:20:14 +0000
commit8c8b002dd6c7ac13ed6b93bcfd4d24da2ac30429 (patch)
tree22c5f70de72808cf3d244b240cabd7ff097d363c /src/station_cmd.cpp
parent382c45120bd1b3c1e4834983445e1d45f5695bc7 (diff)
downloadopenttd-8c8b002dd6c7ac13ed6b93bcfd4d24da2ac30429.tar.xz
(svn r13293) -Fix (r13226): airport far from a town generated too much noise
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index ec73c0a07..97b0bd9c6 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1688,11 +1688,11 @@ uint8 GetAirportNoiseLevelForTown(const AirportFTAClass *afc, TileIndex town_til
/* 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);
+ uint noise_reduction = distance / town_tolerance_distance;
- /* If the noise reduction equals the airport noise itself, don't give it for free. Use it all minus 1.
+ /* 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.