From a1d1ff139b5f5ab8a9e3a8b1a6c740d8d54bba5d Mon Sep 17 00:00:00 2001 From: tripp <86533397+trippjoe@users.noreply.github.com> Date: Sun, 13 Apr 2025 00:42:50 -0400 Subject: [PATCH] Fix for running extractor without optional game flag (#3896) Co-authored-by: Tyler Wilding --- decompiler/extractor/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/decompiler/extractor/main.cpp b/decompiler/extractor/main.cpp index b969556caa..3d203811b5 100644 --- a/decompiler/extractor/main.cpp +++ b/decompiler/extractor/main.cpp @@ -92,7 +92,8 @@ std::tuple, ExtractorErrorCode> validate( } lg::error("Overall ISO content's hash does not match. Expected '{}', Actual '{}'", all_expected, expected_hash); - return {std::nullopt, ExtractorErrorCode::VALIDATION_FILE_CONTENTS_UNEXPECTED}; + return {std::make_optional(version_info), + ExtractorErrorCode::VALIDATION_FILE_CONTENTS_UNEXPECTED}; } return { @@ -302,6 +303,7 @@ int main(int argc, char** argv) { // We know the version since we just extracted it, so the user didn't need to provide this // explicitly data_subfolder = data_subfolders.at(version_info->game_name); + game_name = version_info->game_name; if (!extraction_path.empty()) { iso_data_path = extraction_path / data_subfolder; } else { @@ -337,6 +339,10 @@ int main(int argc, char** argv) { (flag_fail_on_validation && validate_code != ExtractorErrorCode::SUCCESS)) { return static_cast(validate_code); } + if (version_info) { + data_subfolder = data_subfolders.at(version_info->game_name); + game_name = version_info->game_name; + } } // write out a json file with some metadata for the game