summaryrefslogtreecommitdiff
path: root/ecs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-09-23 18:22:44 +0200
committerHampusM <hampus@hampusmat.com>2025-09-23 18:22:44 +0200
commit9fcb8f884c3d302aa1a641a0b43fb6b011cef8db (patch)
tree435e3fac86ef0bd44ab466d23efb48774cf9f01a /ecs
parent20c45467612ff2448b87ce731f939145c6e3a3b1 (diff)
feat(ecs): add component name to add component error msg
Diffstat (limited to 'ecs')
-rw-r--r--ecs/src/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs
index 77d40db..8ce2e7b 100644
--- a/ecs/src/lib.rs
+++ b/ecs/src/lib.rs
@@ -500,11 +500,13 @@ impl World
for component_parts in component_iter {
let comp_id = component_parts.id();
+ let comp_name = component_parts.name();
+
if let Err(err) = component_storage.add_entity_component(
entity_uid,
- (comp_id, component_parts.name(), component_parts.into_data()),
+ (comp_id, comp_name, component_parts.into_data()),
) {
- tracing::error!("Failed to add component to entity: {err}");
+ tracing::error!("Failed to add component {comp_name} to entity: {err}");
continue;
}