diff options
-rw-r--r-- | engines/hdb/hdb.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index ebeb4ae4f4..d0b4b51e94 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -757,10 +757,22 @@ Common::Error HDBGame::run() { if (ConfMan.hasKey("boot_param")) { char mapname[10]; - int level = ConfMan.getInt("boot_param"); + int level = 0; - if (level > 30 || level < 0) + int arg = ConfMan.getInt("boot_param"); + + if (arg < 0 || arg > 130 || (30 < arg && arg < 100)) { + setActionMode(0); level = 1; + } else if (100 <= arg && arg <= 130) { + setActionMode(1); + level = arg - 100; + } else if (0 <= arg && arg <= 30) { + setActionMode(0); + level = arg; + } + + debug("Starting level %d in %s", level, getActionMode() ? "Action Mode" : "Puzzle Mode"); snprintf(mapname, 10, "MAP%02d", level); _ai->clearPersistent(); |