Skip to content
Snippets Groups Projects
Verified Commit 3dd73b79 authored by Louis's avatar Louis :fire:
Browse files

Fix external level loading for non-root project files

parent 477d3b3a
No related branches found
No related tags found
No related merge requests found
......@@ -209,9 +209,13 @@ impl AssetLoader for LdtkLoader {
.map(|path| (level.identifier.clone(), path))
});
let parent_path = load_context.path().parent().map(|pp| pp.to_path_buf());
for (id, path) in levels {
load_context.labeled_asset_scope(id, |lc| {
lc.load::<Level>(path);
match &parent_path {
Some(parent) => lc.load::<Level>(parent.join(path)),
None => lc.load::<Level>(path),
};
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment