Skip to content

Commit

Permalink
Update unpatch
Browse files Browse the repository at this point in the history
  • Loading branch information
NotThorny committed Sep 1, 2024
1 parent a725cdd commit 38b5fce
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src-tauri/src/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ pub async fn patch_game(newer_game: bool, version: String) -> bool {
return true;
}

if version == "50" {
let replaced50 = file_helpers::copy_file_with_new_name(
patch_path.clone().to_str().unwrap().to_string(),
get_game_rsa_path().await.unwrap(),
String::from("Astrolabe.dll"),
);

if replaced50 {
return true;
} else {
return false;
}
}

// Copy the patch to game files
let replaced = file_helpers::copy_file_with_new_name(
patch_path.clone().to_str().unwrap().to_string(),
Expand Down Expand Up @@ -249,6 +263,14 @@ pub async fn unpatch_game() -> bool {
.to_string(),
);

file_helpers::delete_file(
PathBuf::from(get_game_rsa_path().await.unwrap())
.join("Astrolabe.dll")
.to_str()
.unwrap()
.to_string(),
);

let core_patch_path = PathBuf::from(system_helpers::install_location());
let patch_path = core_patch_path.clone().join("altpatch/mihoyonet.dll");
let backup_path = core_patch_path
Expand Down

0 comments on commit 38b5fce

Please sign in to comment.