Fix untyped asset loads after #14808. (#15399)

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.
This commit is contained in:
Patrick Walton 2024-09-24 04:31:36 -07:00 committed by GitHub
parent 3d0f2409d5
commit b5eebb3e36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(