Skip to content

Commit

Permalink
Fix untyped asset loads after #14808. (#15399)
Browse files Browse the repository at this point in the history
The logic in PR #14808 broke `bevy_asset_loader`, because calling
`AssetServer::load_untyped()` initiates a load of an asset of type
`LoadedUntypedAsset`, which doesn't match any asset loaders and
therefore fails. I reverted the lines that were causing the problem. The
resulting code seems to work, but I'm not sure if this was the correct
fix.
  • Loading branch information
pcwalton authored Sep 24, 2024
1 parent 3d0f240 commit b5eebb3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/bevy_asset/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,11 @@ impl AssetServer {
return handle;
}
let id = handle.id().untyped();
let owned_handle = Some(handle.clone().untyped());

let server = self.clone();
let task = IoTaskPool::get().spawn(async move {
let path_clone = path.clone();
match server.load_internal(owned_handle, path, false, None).await {
match server.load_untyped_async(path).await {
Ok(handle) => server.send_asset_event(InternalAssetEvent::Loaded {
id,
loaded_asset: LoadedAsset::new_with_dependencies(
Expand Down

0 comments on commit b5eebb3

Please sign in to comment.