diff --git a/CHANGELOG.md b/CHANGELOG.md index a3b5aff..dd3fb5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ A [migration guide](https://adrien-bon.github.io/bevy_ecs_tiled/migrations/v0_5. - Do not skip last frame for animated tiles (#61) - Make sure all custom properties we export have the 'useAs property' flag set (and only this one) Not having this flag was preventing to use some some of the properties +- Prevent infinite loop in case of an asset loading error ## v0.4.2 diff --git a/examples/my_tiled_export_file.json b/examples/my_tiled_export_file.json index d5dac13..69836dc 100644 --- a/examples/my_tiled_export_file.json +++ b/examples/my_tiled_export_file.json @@ -880,7 +880,7 @@ { "name": "hash", "type": "int", - "value": 11479900986833011021 + "value": 16351517434635875896 }, { "name": "name", diff --git a/src/lib.rs b/src/lib.rs index 01a9da9..51868cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,7 @@ pub mod prelude { } use crate::prelude::*; -use bevy::prelude::*; +use bevy::{asset::RecursiveDependencyLoadState, prelude::*}; use bevy_ecs_tilemap::prelude::*; use std::{env, path::PathBuf}; @@ -140,6 +140,10 @@ fn process_loaded_maps( { if let Some(load_state) = asset_server.get_recursive_dependency_load_state(&map_handle.0) { if !load_state.is_loaded() { + if let RecursiveDependencyLoadState::Failed(err) = load_state { + error!("Error loading map: {}", err); + return; + } // If not fully loaded yet, insert the 'Respawn' marker so we will try to load it at next frame commands.entity(map_entity).insert(RespawnTiledMap); debug!(