summaryrefslogtreecommitdiff
path: root/ecs/src/actions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/actions.rs')
-rw-r--r--ecs/src/actions.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ecs/src/actions.rs b/ecs/src/actions.rs
index babd5a2..c062472 100644
--- a/ecs/src/actions.rs
+++ b/ecs/src/actions.rs
@@ -44,6 +44,10 @@ impl<'world> Actions<'world>
{
debug_assert_eq!(entity_uid.kind(), UidKind::Entity);
+ if Comps::metadata().len() == 0 {
+ return;
+ }
+
self.action_queue.push(Action::AddComponents(
entity_uid,
components.into_vec(),
@@ -58,6 +62,10 @@ impl<'world> Actions<'world>
{
debug_assert_eq!(entity_uid.kind(), UidKind::Entity);
+ if Comps::metadata().len() == 0 {
+ return;
+ }
+
self.action_queue.push(Action::RemoveComponents(
entity_uid,
Comps::metadata(),