From ba455470386edd09981b1df0a1ee967598256b3e Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 5 Sep 2022 12:24:06 -0500 Subject: [PATCH] Only clear source handles if `PannerStrategy` is actually changed (I.e. mutated, not added.) --- src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 37a8c09..df5033e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -332,13 +332,15 @@ fn swap_buffers( } fn change_panner_strategy( - changed: Query>, + changed: Query<(Entity, ChangeTrackers)>, removed: RemovedComponents, mut sources: Query<&mut Source>, ) { let mut check = vec![]; - for entity in &changed { - check.push(entity); + for (entity, change) in &changed { + if !change.is_added() && change.is_changed() { + check.push(entity); + } } for entity in removed.iter() { check.push(entity);