Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: fix semver checking logic for jak 2 #370

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
}
}
Loading