From e5fc77228875459949201f20d402bf5e82e94892 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 6 Mar 2025 11:36:17 +0100 Subject: [PATCH] Return object on save game load --- rpg_components/src/config/save_game.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpg_components/src/config/save_game.rs b/rpg_components/src/config/save_game.rs index 02bdb67..b3167e5 100644 --- a/rpg_components/src/config/save_game.rs +++ b/rpg_components/src/config/save_game.rs @@ -362,7 +362,7 @@ impl SaveGame { pub fn to_entity_object( self, world: &mut World, - ) -> Result<(Entity, String)> { + ) -> Result<(EntityObject, String)> { let mut entity_object = AssetHandler::create(world).empty_entity(); entity_object.insert_component(Draw::new(Vec::new())); @@ -397,6 +397,6 @@ impl SaveGame { entity_object.insert_component(statistics); entity_object.insert_component(current_status); - Ok((world.add_entity(entity_object)?, self.general.name)) + Ok((entity_object, self.general.name)) } }