From c7b1ad3145c1e2956689b891d8ee0de603d0a158 Mon Sep 17 00:00:00 2001 From: Patrick Dobbs Date: Thu, 24 Oct 2024 23:22:58 +0100 Subject: [PATCH] Update a couple of deprecated bits --- crates/blenvy/src/blueprints/spawn_from_blueprints.rs | 7 ++----- crates/blenvy/src/save_load/loading.rs | 5 +---- crates/blenvy/src/save_load/saving.rs | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/crates/blenvy/src/blueprints/spawn_from_blueprints.rs b/crates/blenvy/src/blueprints/spawn_from_blueprints.rs index 980fb50..26d15d9 100644 --- a/crates/blenvy/src/blueprints/spawn_from_blueprints.rs +++ b/crates/blenvy/src/blueprints/spawn_from_blueprints.rs @@ -514,11 +514,8 @@ pub(crate) fn blueprints_assets_loaded( //println!("ANIMATION INFOS: {:?}", animation_infos); commands.entity(entity).insert(( - SceneBundle { - scene: SceneRoot(scene.clone()), - transform: transforms, - ..Default::default() - }, + SceneRoot(scene.clone()), + transforms, OriginalChildren(original_children), BlueprintAnimations { // TODO: perhaps swap this out with InstanceAnimations depending on whether we are spawning a level or a simple blueprint diff --git a/crates/blenvy/src/save_load/loading.rs b/crates/blenvy/src/save_load/loading.rs index 782d99b..8bddeac 100644 --- a/crates/blenvy/src/save_load/loading.rs +++ b/crates/blenvy/src/save_load/loading.rs @@ -83,10 +83,7 @@ pub(crate) fn load_game( // let input = std::fs::read(&path)?; let _dynamic_data = commands .spawn(( - DynamicSceneBundle { - scene: DynamicSceneRoot(asset_server.load(load_request.path.clone())), - ..default() - }, + DynamicSceneRoot(asset_server.load(load_request.path.clone())), bevy::prelude::Name::from("World_dynamic"), DynamicEntitiesRoot, GameWorldTag, diff --git a/crates/blenvy/src/save_load/saving.rs b/crates/blenvy/src/save_load/saving.rs index d9deea5..12fbed2 100644 --- a/crates/blenvy/src/save_load/saving.rs +++ b/crates/blenvy/src/save_load/saving.rs @@ -86,7 +86,7 @@ pub(crate) fn save_game(world: &mut World) { let mut save_path: String = "".into(); let mut events = world.resource_mut::>(); - for event in events.get_reader().read(&events) { + for event in events.get_cursor().read(&events) { info!("SAVE EVENT !! {:?}", event); save_path.clone_from(&event.path); }