diff options
author | Filippos Karapetis | 2012-06-11 20:28:28 +0300 |
---|---|---|
committer | Filippos Karapetis | 2012-06-11 21:17:19 +0300 |
commit | 15306bc554b926e7d50f6a443766065e684557f3 (patch) | |
tree | 92f0fcea100a7a831e2dfb648dd2cd09b2edf5b6 | |
parent | 3fde390e006963f354c0678640c70f49753907ef (diff) | |
download | scummvm-rg350-15306bc554b926e7d50f6a443766065e684557f3.tar.gz scummvm-rg350-15306bc554b926e7d50f6a443766065e684557f3.tar.bz2 scummvm-rg350-15306bc554b926e7d50f6a443766065e684557f3.zip |
SCI: Return the default value for unknown configuration settings
Based on a patch by LePhilousophe
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index f243cf2ffe..1cbaf0708d 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -396,18 +396,17 @@ reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) { reg_t kGetSierraProfileInt(EngineState *s, int argc, reg_t *argv) { Common::String category = s->_segMan->getString(argv[0]); // always "config" category.toLowercase(); - if (category != "config") - error("GetSierraProfileInt: category isn't 'config', it's '%s'", category.c_str()); - Common::String setting = s->_segMan->getString(argv[1]); setting.toLowercase(); - if (setting != "videospeed") - error("GetSierraProfileInt: setting isn't 'videospeed', it's '%s'", setting.c_str()); + // The third parameter is the default value returned if the configuration key is missing - // The third parameter is 425 (the default if the configuration key is missing) + if (category == "config" && setting == "videospeed") { + // We return the same fake value for videospeed as with kGetConfig + return make_reg(0, 500); + } - // We return the same fake value for videospeed as with kGetConfig - return make_reg(0, 500); + warning("kGetSierraProfileInt: Returning default value %d for unknown setting %s.%s", argv[2].toSint16(), category.c_str(), setting.c_str()); + return argv[2]; } #endif |