Also return name

This commit is contained in:
hodasemi 2024-08-26 13:30:49 +02:00
parent 537d050287
commit bdbbb4267e

View file

@ -359,7 +359,7 @@ create_settings_container!(
); );
impl SaveGame { impl SaveGame {
pub fn to_entity_object(self, engine: &Engine) -> Result<Entity> { pub fn to_entity_object(self, engine: &Engine) -> Result<(Entity, String)> {
let scene = engine.scene_mut(); let scene = engine.scene_mut();
let experience_settings = scene.resources.get::<ExperienceSettings>(); let experience_settings = scene.resources.get::<ExperienceSettings>();
@ -396,6 +396,6 @@ impl SaveGame {
entity_object.insert_component(statistics); entity_object.insert_component(statistics);
entity_object.insert_component(current_status); entity_object.insert_component(current_status);
scene.add_entity(entity_object) Ok((scene.add_entity(entity_object)?, self.general.name))
} }
} }