Skip to content

Commit

Permalink
de_core: Fix asset_path()
Browse files Browse the repository at this point in the history
  • Loading branch information
JackCrumpLeys authored and Indy2222 committed May 9, 2023
1 parent c27b101 commit 22f0dff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/core/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ pub fn asset_path<P: AsRef<Path>>(path: P) -> PathBuf {
assert!(path.is_relative(), "Asset path is not relative: {path:?}");
let mut new_path = match env::var("CARGO_MANIFEST_DIR") {
Ok(path) => PathBuf::from(path),
Err(_) => {
current_exe().expect("Failed to retrieve current executable path during map loading")
}
Err(_) => current_exe()
.expect("Failed to retrieve current executable path during map loading")
.parent()
.unwrap()
.to_path_buf(),
};
new_path.push("assets");
new_path.push(path);
Expand Down

0 comments on commit 22f0dff

Please sign in to comment.