Skip to content

Commit

Permalink
Fix missing asset info path for synchronous loading (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
voxelias authored Sep 14, 2020
1 parent b0e64d4 commit b3e339e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_asset/src/asset_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,15 @@ impl AssetServer {
.to_str()
.expect("extension should be a valid string"),
) {
let mut asset_info_paths = self.asset_info_paths.write();
let handle_id = HandleId::new();
let resources = &self.loaders[*index];
let loader = resources.get::<Box<dyn AssetLoader<T>>>().unwrap();
let asset = loader.load_from_file(path)?;
let handle = Handle::from(handle_id);

assets.set(handle, asset);
asset_info_paths.insert(path.to_owned(), handle_id);
Ok(handle)
} else {
Err(AssetServerError::MissingAssetHandler)
Expand Down

0 comments on commit b3e339e

Please sign in to comment.