backend: fix semver checking logic for jak 2 (#370)

This commit is contained in:
Tyler Wilding 2023-11-04 23:33:37 -04:00 committed by GitHub
parent 407b0fc07f
commit 9810f94013
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -298,7 +298,7 @@ pub async fn extract_and_validate_iso(
args.push("--folder".to_string());
}
// Add new --game argument
if config_info.tooling_version.minor >= 1 && config_info.tooling_version.patch >= 44 {
if config_info.tooling_version.minor > 1 || config_info.tooling_version.patch >= 44 {
args.push("--game".to_string());
args.push(game_name.clone());
}
@ -306,6 +306,8 @@ pub async fn extract_and_validate_iso(
// This is the first install step, reset the file
let log_file = create_log_file(&app_handle, "extractor.log", false)?;
log::info!("Running extractor with args: {:?}", args);
let mut command = Command::new(exec_info.executable_path);
command
.args(args)
@ -397,11 +399,13 @@ pub async fn run_decompiler(
data_folder.to_string_lossy().into_owned(),
];
// Add new --game argument
if config_info.tooling_version.minor >= 1 && config_info.tooling_version.patch >= 44 {
if config_info.tooling_version.minor > 1 || config_info.tooling_version.patch >= 44 {
args.push("--game".to_string());
args.push(game_name.clone());
}
log::info!("Running extractor with args: {:?}", args);
command
.args(args)
.stdout(log_file.try_clone()?)
@ -489,10 +493,13 @@ pub async fn run_compiler(
data_folder.to_string_lossy().into_owned(),
];
// Add new --game argument
if config_info.tooling_version.minor >= 1 && config_info.tooling_version.patch >= 44 {
if config_info.tooling_version.minor > 1 || config_info.tooling_version.patch >= 44 {
args.push("--game".to_string());
args.push(game_name.clone());
}
log::info!("Running compiler with args: {:?}", args);
let mut command = Command::new(exec_info.executable_path);
command
.args(args)
@ -680,7 +687,7 @@ fn generate_launch_game_string(
data_folder.to_string_lossy().into_owned(),
];
// Add new --game argument
if config_info.tooling_version.minor >= 1 && config_info.tooling_version.patch >= 44 {
if config_info.tooling_version.minor > 1 || config_info.tooling_version.patch >= 44 {
args.push("--game".to_string());
args.push(game_name.clone());
}

View file

@ -410,7 +410,7 @@ pub async fn does_active_tooling_version_support_game(
.unwrap_or(Version::new(0, 0, 1));
match game_name.as_str() {
"jak1" => Ok(true),
"jak2" => Ok(tooling_version.minor >= 1 && tooling_version.patch >= 44),
"jak2" => Ok(tooling_version.minor > 1 || tooling_version.patch >= 44),
_ => Ok(false),
}
}