From 20ae7fbaf133cf7f918b0b5eca5b5e3ca3aa2b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilja=20Karta=C5=A1ov?= Date: Mon, 14 Sep 2020 23:14:54 +0200 Subject: [PATCH] Fix missing asset info path for synchronous loading (#486) --- crates/bevy_asset/src/asset_server.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/bevy_asset/src/asset_server.rs b/crates/bevy_asset/src/asset_server.rs index 1cee72e6f449d..e473476acf0a7 100644 --- a/crates/bevy_asset/src/asset_server.rs +++ b/crates/bevy_asset/src/asset_server.rs @@ -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::>>().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)