summaryrefslogtreecommitdiff
path: root/misc_cmd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-24 16:13:37 +0000
committerDarkvater <darkvater@openttd.org>2005-05-24 16:13:37 +0000
commit1498d42ef6b271047992b8308aa8adb7e7f65b43 (patch)
treeaa4b2baac928e6c327507b73f78234209e071903 /misc_cmd.c
parenta2f691b24ae9de208fa997ac5766c59cc26dd7fa (diff)
downloadopenttd-1498d42ef6b271047992b8308aa8adb7e7f65b43.tar.xz
(svn r2364) - Fix (regression): [ 1206850 ] Cannot change difficulty in main menu, always the value it was before you changed it. A too rigid check forgot to check the parameter value -1 which set the difficulty level itself.
Diffstat (limited to 'misc_cmd.c')
-rw-r--r--misc_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc_cmd.c b/misc_cmd.c
index c1e7e1e41..e26b4b346 100644
--- a/misc_cmd.c
+++ b/misc_cmd.c
@@ -256,7 +256,7 @@ int32 CmdGiveMoney(int x, int y, uint32 flags, uint32 p1, uint32 p2)
*/
int32 CmdChangeDifficultyLevel(int x, int y, uint32 flags, uint32 p1, uint32 p2)
{
- if (p1 >= GAME_DIFFICULTY_NUM) return CMD_ERROR;
+ if ((int32)p1 >= GAME_DIFFICULTY_NUM && p1 != (uint32)-1L) return CMD_ERROR;
if (flags & DC_EXEC) {
if (p1 != (uint32)-1L) {