summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-05-24 02:54:47 +0000
committerbelugas <belugas@openttd.org>2008-05-24 02:54:47 +0000
commitfc35ad9ee9077869ab7b5a06b44327c835df3e5f (patch)
tree6e9667beb04ac4a18b43294a74456ab52a123a5a /src/misc_cmd.cpp
parent6f233b1f8f18beb1e347c943685f6086d886993e (diff)
downloadopenttd-fc35ad9ee9077869ab7b5a06b44327c835df3e5f.tar.xz
(svn r13226) -Feature: Allow to have more than only two airports per town. The number of airports is now controlled by the noise each of them generates, the distance from town's center and how tolerant the town is.
Initial concept : TTDPatch (moreairpots), Initial code : Pasky Thanks to BigBB (help coding), Smatz Skidd13 and frosch for bugcatches and advices
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 84579e113..0e6c2bc22 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -22,6 +22,7 @@
#include "player_base.h"
#include "player_gui.h"
#include "settings_type.h"
+#include "station_func.h"
#include "table/strings.h"
@@ -402,6 +403,15 @@ CommandCost CmdChangeDifficultyLevel(TileIndex tile, uint32 flags, uint32 p1, ui
_opt_ptr->diff_level = p2;
}
+ /* Since the tolerance of the town council has a direct impact on the noise generation/tolerance,
+ * launch a re-evaluation of the actual values only when setting has changed */
+ if (p2 == GAME_DIFFICULTY_TOWNCOUNCIL_TOLERANCE && _game_mode == GM_NORMAL) {
+ UpdateAirportsNoise();
+ if (_patches.station_noise_level) {
+ InvalidateWindowClassesData(WC_TOWN_VIEW, 0);
+ }
+ }
+
/* If we are a network-client, update the difficult setting (if it is open).
* Use this instead of just dirtying the window because we need to load in
* the new difficulty settings */