summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-26 00:31:36 +0000
committerrubidium <rubidium@openttd.org>2008-05-26 00:31:36 +0000
commitcd8e589fa9c744a24d550de0dcd549f00ea6de1c (patch)
tree3f44a1d9be6c38b45ad872a47f1b32469c469497 /src/misc_cmd.cpp
parent8c9cc415e3eac6a7709f6a8978f213311416312e (diff)
downloadopenttd-cd8e589fa9c744a24d550de0dcd549f00ea6de1c.tar.xz
(svn r13256) -Codechange: merge the OPTS and PATS chuncks.
-Codechange: split the diff_custom variable. -Feature: allow changing some of the diff_custom variables via the console in network games.
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 49e3eafdb..6da4895fb 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -22,7 +22,6 @@
#include "player_base.h"
#include "player_gui.h"
#include "settings_type.h"
-#include "station_func.h"
#include "table/strings.h"
@@ -380,46 +379,3 @@ CommandCost CmdGiveMoney(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* Subtract money from local-player */
return amount;
}
-
-/** Change difficulty level/settings (server-only).
- * We cannot really check for valid values of p2 (too much work mostly); stored
- * in file 'settings_gui.c' _game_setting_info[]; we'll just trust the server it knows
- * what to do and does this correctly
- * @param tile unused
- * @param flags operation to perform
- * @param p1 the difficulty setting being changed. If it is -1, the difficulty level
- * itself is changed. The new value is inside p2
- * @param p2 new value for a difficulty setting or difficulty level
- */
-CommandCost CmdChangeDifficultyLevel(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
-{
- if (p1 != (uint32)-1L && ((int32)p1 >= GAME_DIFFICULTY_NUM || (int32)p1 < 0)) return CMD_ERROR;
-
- DifficultySettings *opt_ptr = (_game_mode == GM_MENU) ? &_settings_newgame.difficulty : &_settings.difficulty;
-
- if (flags & DC_EXEC) {
- if (p1 != (uint32)-1L) {
- ((GDType*)opt_ptr)[p1] = p2;
- opt_ptr->diff_level = 3; // custom difficulty level
- } else {
- 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 (_settings.economy.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 */
- if (_networking && !_network_server && FindWindowById(WC_GAME_OPTIONS, 0) != NULL) {
- ShowGameDifficulty();
- }
- }
- return CommandCost();
-}