mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
Don't export empty entities
This commit is contained in:
@@ -42,9 +42,13 @@ pub(super) fn save_scene_system(world: &mut World) -> Result<(), String> {
|
||||
scene.entities = scene
|
||||
.entities
|
||||
.into_iter()
|
||||
.map(|mut ent| {
|
||||
.filter_map(|mut ent| {
|
||||
ent.components = ent.components.into_iter().filter(is_serializable).collect();
|
||||
ent
|
||||
if ent.components.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(ent)
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user