diff options
Diffstat (limited to 'misc_cmd.c')
-rw-r--r-- | misc_cmd.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/misc_cmd.c b/misc_cmd.c index d45a6978c..1ecc9c24e 100644 --- a/misc_cmd.c +++ b/misc_cmd.c @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "ttd.h" #include "string.h" @@ -7,6 +6,7 @@ #include "player.h" #include "gfx.h" #include "window.h" +#include "gui.h" #include "saveload.h" #include "economy.h" #include "network.h" @@ -222,15 +222,14 @@ int32 CmdChangeDifficultyLevel(int x, int y, uint32 flags, uint32 p1, uint32 p2) { if (flags & DC_EXEC) { if (p1 != (uint32)-1L) { - ((int*)&_opt_mod_ptr->diff)[p1] = p2; - _opt_mod_ptr->diff_level = 3; - } else { - _opt_mod_ptr->diff_level = p2; - } + ((int*)&_opt_ptr->diff)[p1] = p2; + _opt_ptr->diff_level = 3; + } else + _opt_ptr->diff_level = p2; + // If we are a network-client, update the difficult setting (if it is open) if (_networking && !_network_server && FindWindowById(WC_GAME_OPTIONS, 0) != NULL) - memcpy(&_opt_mod_temp, _opt_mod_ptr, sizeof(GameOptions)); - InvalidateWindow(WC_GAME_OPTIONS, 0); + ShowGameDifficulty(); } return 0; } |