summaryrefslogtreecommitdiff
path: root/engine-ecs/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine-ecs/src/lib.rs')
-rw-r--r--engine-ecs/src/lib.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/engine-ecs/src/lib.rs b/engine-ecs/src/lib.rs
index b682906..62d2f71 100644
--- a/engine-ecs/src/lib.rs
+++ b/engine-ecs/src/lib.rs
@@ -629,15 +629,13 @@ impl World
continue;
}
- if let Some(type_reflection) = component_parts.type_reflection {
- Self::create_component_info_entity(
- comp_id,
- comp_name,
- type_reflection,
- comp_type_id,
- component_storage,
- );
- }
+ Self::create_component_info_entity_if_missing(
+ comp_id,
+ comp_name,
+ component_parts.type_reflection,
+ comp_type_id,
+ component_storage,
+ );
event_submitter.submit_event(
&Pair::builder()
@@ -649,10 +647,10 @@ impl World
}
}
- fn create_component_info_entity(
+ fn create_component_info_entity_if_missing(
comp_id: Uid,
comp_name: &'static str,
- type_reflection: &'static TypeReflection,
+ type_reflection: Option<&'static TypeReflection>,
type_id: TypeId,
component_storage: &mut ComponentStorage,
)