Skip to content

Commit

Permalink
Moved dobby scan to check Game Directory after Base Directory
Browse files Browse the repository at this point in the history
  • Loading branch information
HerpDerpinstine committed Oct 11, 2024
1 parent 934b1d7 commit e239e7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions MelonProxy/src/utils/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ pub fn get_bootstrap_path(base_path: &PathBuf) -> Result<PathBuf, io::Error> {
/// search for Bootstrap in the given path
pub fn get_dobby_dir(base_path: PathBuf, game_dir: PathBuf) -> Result<PathBuf, io::Error> {
let dobby_names = ["dobby", "libdobby"]; //by convention, on unix, the library is prefixed with "lib"

for name in dobby_names.iter() {
let dobby_path = game_dir.join(name).with_extension(DLL_EXTENSION);

if dobby_path.exists() {
return Ok(game_dir);
}
}

for name in dobby_names.iter() {
let dobby_path = base_path.join(name).with_extension(DLL_EXTENSION);
Expand All @@ -59,6 +51,14 @@ pub fn get_dobby_dir(base_path: PathBuf, game_dir: PathBuf) -> Result<PathBuf, i
return Ok(path);
}
}

for name in dobby_names.iter() {
let dobby_path = game_dir.join(name).with_extension(DLL_EXTENSION);

if dobby_path.exists() {
return Ok(game_dir);
}
}

Err(io::Error::new(
ErrorKind::NotFound,
Expand Down

0 comments on commit e239e7a

Please sign in to comment.