Skip to content

Commit

Permalink
backend: fix semver checking logic for jak 2 (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored Nov 5, 2023
1 parent 407b0fc commit 9810f94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src-tauri/src/commands/binaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,16 @@ 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());
}

// 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)
Expand Down Expand Up @@ -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()?)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/commands/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

0 comments on commit 9810f94

Please sign in to comment.