From 4d468fb00504ddf3bb91418bf36ab57901799c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Thu, 17 Mar 2022 15:48:01 +0100 Subject: [PATCH] SCUMM: Update the game's "extra" setting, if necessary This would have been done at detection, but if the game entry is really old it may still be empty. We sometimes need it to tell versions apart. --- engines/scumm/metaengine.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp index 653571f909f..998774f6161 100644 --- a/engines/scumm/metaengine.cpp +++ b/engines/scumm/metaengine.cpp @@ -336,6 +336,12 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) { // file transparently. Common::updateGameGUIOptions(res.game.guioptions, getGameGUIOptionsDescriptionLanguage(res.language)); + // If the game was added really long ago, it may be missing its "extra" + // field. When adding game-specific options, it may be our only way of + // telling certain versions apart, so make sure it's updated. + if (res.game.variant && res.game.variant[0] && !ConfMan.hasKey("extra")) + ConfMan.setAndFlush("extra", res.game.variant); + // Check for a user override of the platform. We allow the user to override // the platform, to make it possible to add games which are not yet in // our MD5 database but require a specific platform setting. @@ -527,10 +533,8 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GU if (ConfMan.get("gameid", target) != "loom") return nullptr; - // These Loom settings are only relevant for the EGA version, so - // exclude non-DOS versions. If the game was added a long time ago, - // the platform may still be listed as unknown, and there may be no - // "extra" field to query. + // These Loom settings are only relevant for the EGA version, since + // that is the only one that has an overture. Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target)); if (platform != Common::kPlatformUnknown && platform != Common::kPlatformDOS) @@ -541,7 +545,6 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildEngineOptionsWidgetDynamic(GU if (extra == "Steam" || extra == "VGA") return nullptr; - // So we still can't be quite sure it's the EGA version. Oh well... return new Scumm::LoomEgaGameOptionsWidget(boss, name, target); }