From c593159dd84aef234cda170fbe5dedec0a8f9d63 Mon Sep 17 00:00:00 2001 From: lolbot-iichan Date: Sun, 21 Jul 2019 15:26:49 +0300 Subject: WINTERMUTE: Fix language selection regression bug for Reversion Ooops. Latest refactoring of those if/else blocks was wrong, as a result Reversion 1&2 ignored all the xlanguage packages. Fixed. --- engines/wintermute/base/base_file_manager.cpp | 66 ++++++++++++++++++--------- 1 file changed, 44 insertions(+), 22 deletions(-) (limited to 'engines/wintermute/base') diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp index a9a19df11c..afcbd5b837 100644 --- a/engines/wintermute/base/base_file_manager.cpp +++ b/engines/wintermute/base/base_file_manager.cpp @@ -228,38 +228,60 @@ bool BaseFileManager::registerPackages() { // TODO: Select based on the gameDesc. if (_language != Common::UNK_LANG) { // English - if (_language != Common::EN_ANY && (fileName == "english.dcp" || fileName == "xlanguage_en.dcp" || fileName == "english_language_pack.dcp")) { - continue; + if (fileName == "english.dcp" || fileName == "xlanguage_en.dcp" || fileName == "english_language_pack.dcp") { + if (_language != Common::EN_ANY) { + continue; + } // Chinese - } else if (_language != Common::ZH_CNA && (fileName == "chinese.dcp" || fileName == "xlanguage_nz.dcp" || fileName == "chinese_language_pack.dcp")) { - continue; + } else if (fileName == "chinese.dcp" || fileName == "xlanguage_nz.dcp" || fileName == "chinese_language_pack.dcp") { + if (_language != Common::ZH_CNA) { + continue; + } // Czech - } else if (_language != Common::CZ_CZE && (fileName == "czech.dcp" || fileName == "xlanguage_cz.dcp" || fileName == "czech_language_pack.dcp")) { - continue; + } else if (fileName == "czech.dcp" || fileName == "xlanguage_cz.dcp" || fileName == "czech_language_pack.dcp") { + if (_language != Common::CZ_CZE) { + continue; + } // French - } else if (_language != Common::FR_FRA && (fileName == "french.dcp" || fileName == "xlanguage_fr.dcp" || fileName == "french_language_pack.dcp")) { - continue; + } else if (fileName == "french.dcp" || fileName == "xlanguage_fr.dcp" || fileName == "french_language_pack.dcp") { + if (_language != Common::FR_FRA) { + continue; + } // German - } else if (_language != Common::DE_DEU && (fileName == "german.dcp" || fileName == "xlanguage_de.dcp" || fileName == "german_language_pack.dcp")) { - continue; + } else if (fileName == "german.dcp" || fileName == "xlanguage_de.dcp" || fileName == "german_language_pack.dcp") { + if (_language != Common::DE_DEU) { + continue; + } // Italian - } else if (_language != Common::IT_ITA && (fileName == "italian.dcp" || fileName == "xlanguage_it.dcp" || fileName == "italian_language_pack.dcp")) { - continue; + } else if (fileName == "italian.dcp" || fileName == "xlanguage_it.dcp" || fileName == "italian_language_pack.dcp") { + if (_language != Common::IT_ITA) { + continue; + } // Latvian - } else if (_language != Common::LV_LAT && (fileName == "latvian.dcp" || fileName == "xlanguage_lv.dcp" || fileName == "latvian_language_pack.dcp")) { - continue; + } else if (fileName == "latvian.dcp" || fileName == "xlanguage_lv.dcp" || fileName == "latvian_language_pack.dcp") { + if (_language != Common::LV_LAT) { + continue; + } // Polish - } else if (_language != Common::PL_POL && (fileName == "polish.dcp" || fileName == "xlanguage_pl.dcp" || fileName == "polish_language_pack.dcp")) { - continue; + } else if (fileName == "polish.dcp" || fileName == "xlanguage_pl.dcp" || fileName == "polish_language_pack.dcp") { + if (_language != Common::PL_POL) { + continue; + } // Portuguese - } else if (_language != Common::PT_BRA && (fileName == "portuguese.dcp" || fileName == "xlanguage_pt.dcp" || fileName == "portuguese_language_pack.dcp")) { - continue; + } else if (fileName == "portuguese.dcp" || fileName == "xlanguage_pt.dcp" || fileName == "portuguese_language_pack.dcp") { + if (_language != Common::PT_BRA) { + continue; + } // Russian - } else if (_language != Common::RU_RUS && (fileName == "russian.dcp" || fileName == "xlanguage_ru.dcp" || fileName == "russian_language_pack.dcp")) { - continue; + } else if (fileName == "russian.dcp" || fileName == "xlanguage_ru.dcp" || fileName == "russian_language_pack.dcp") { + if (_language != Common::RU_RUS) { + continue; + } // Spanish - } else if (_language != Common::ES_ESP && (fileName == "spanish.dcp" || fileName == "xlanguage_es.dcp" || fileName == "spanish_language_pack.dcp")) { - continue; + } else if (fileName == "spanish.dcp" || fileName == "xlanguage_es.dcp" || fileName == "spanish_language_pack.dcp") { + if (_language != Common::ES_ESP) { + continue; + } // generic } else if (fileName.hasPrefix("xlanguage_")) { warning("Unknown language package: %s", fileName.c_str()); -- cgit v1.2.3