summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-25 12:57:39 +0000
committerrubidium <rubidium@openttd.org>2008-05-25 12:57:39 +0000
commit5fa0946c087408545c22250be1996f3433d94786 (patch)
tree025594bdaef0e1efcf18e01f88e9d25a469cdb7c /src/misc_cmd.cpp
parentf6ea07e7d8ebfebe817eca368df24383887d732a (diff)
downloadopenttd-5fa0946c087408545c22250be1996f3433d94786.tar.xz
(svn r13242) -Codechange: remove _opt_ptr.
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 0e6c2bc22..2dad0e297 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -395,12 +395,14 @@ CommandCost CmdChangeDifficultyLevel(TileIndex tile, uint32 flags, uint32 p1, ui
{
if (p1 != (uint32)-1L && ((int32)p1 >= GAME_DIFFICULTY_NUM || (int32)p1 < 0)) return CMD_ERROR;
+ GameOptions *opt_ptr = (_game_mode == GM_MENU) ? &_opt_newgame : &_opt;
+
if (flags & DC_EXEC) {
if (p1 != (uint32)-1L) {
- ((GDType*)&_opt_ptr->diff)[p1] = p2;
- _opt_ptr->diff_level = 3; // custom difficulty level
+ ((GDType*)&opt_ptr->diff)[p1] = p2;
+ opt_ptr->diff_level = 3; // custom difficulty level
} else {
- _opt_ptr->diff_level = p2;
+ opt_ptr->diff_level = p2;
}
/* Since the tolerance of the town council has a direct impact on the noise generation/tolerance,