From f193d6222ba7572be733d53630f22191c0506c80 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 9 Jul 2026 01:54:02 +0200 Subject: feat(engine-ecs): create component info entity for components without type reflection --- engine-ecs/src/lib.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'engine-ecs/src/lib.rs') 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, ) -- cgit v1.2.3-18-g5258