Skip to content

Commit

Permalink
Fix early get_base_dir call
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonnMal committed Oct 24, 2024
1 parent 2d5027d commit 33d11ad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ extern "system" fn init() {

fn run_init() -> Result<(), Box<dyn Error>> {
unsafe {
if let Some(dir) = get_base_dir("pso2.exe")? {
*PATH.write()? = Some(PathBuf::from(dir));
} else {
*PATH.write()? = Some(PathBuf::new());
}
if !check_ngs() {
process_manip::print_msgbox(
"This DLL is meant for the NGS version of the game",
"Invalid version",
);
return Ok(());
}
if let Some(dir) = get_base_dir("pso2.exe")? {
*PATH.write()? = Some(PathBuf::from(dir));
} else {
*PATH.write()? = Some(PathBuf::new());
}
*SETTINGS.write()? = Some(read_settings());
let settings_lock = SETTINGS.read()?;
let settings = settings_lock.as_ref().unwrap_window();
Expand Down

0 comments on commit 33d11ad

Please sign in to comment.