summaryrefslogtreecommitdiff
path: root/misc_cmd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-03-12 21:21:47 +0000
committerDarkvater <darkvater@openttd.org>2005-03-12 21:21:47 +0000
commit010d1a9be338ec98a1e2ff50ec5b39d309a477ef (patch)
tree3e154dae321b4ae4880a4ae3ad91616338e7b720 /misc_cmd.c
parentc3f9f5efafea127f1dd8e64b627033de3aa44ac8 (diff)
downloadopenttd-010d1a9be338ec98a1e2ff50ec5b39d309a477ef.tar.xz
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
- Fix: [ 1153926 ] All my settings in vain... IGNORED! - Change: I hope I got it all right. Pressing 'New Game' (either choosing random or a preset scenario) and 'Create Scenario' will start a new game with the settings and difficulty in the intro menu. Using 'Load Game' and 'Play Scenario' will take the values from the savegame/scenario itself.
Diffstat (limited to 'misc_cmd.c')
-rw-r--r--misc_cmd.c15
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;
}