From 07d6d99ba7e2956e5c02b8b8e90b6cb99cea2959 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 5 Sep 2022 18:25:00 -0500 Subject: [PATCH] Did a dumb. Revert "If any source components exist on a sound without a source, assume the source should be created there and skip ancestry checks." This reverts commit ed38b30843b0a680002db483b35b3b345c3427c4. --- src/lib.rs | 51 +++++++-------------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0f36a98..d97f8a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -294,56 +294,19 @@ fn add_generator( fn add_sound_without_source( mut commands: Commands, - query: Query< - ( - Entity, - Option<&PannerStrategy>, - Option<&AngularPan>, - Option<&ScalarPan>, - Option<&DistanceModel>, - Option<&DistanceRef>, - Option<&DistanceMax>, - Option<&Rolloff>, - Option<&ClosenessBoost>, - Option<&ClosenessBoostDistance>, - ), - (Added, Without), - >, + query: Query, Without)>, parents: Query<&Parent>, sources: Query<&Source>, ) { - for ( - entity, - panner_strategy, - scalar_pan, - angular_pan, - distance_model, - distance_ref, - distance_max, - rolloff, - closeness_boost, - closeness_boost_distance, - ) in &query - { + for entity in &query { let mut has_source = false; let mut target = entity; - if panner_strategy.is_none() - && angular_pan.is_none() - && scalar_pan.is_none() - && distance_model.is_none() - && distance_ref.is_none() - && distance_max.is_none() - && rolloff.is_none() - && closeness_boost.is_none() - && closeness_boost_distance.is_none() - { - while let Ok(parent) = parents.get(target) { - if sources.get(**parent).is_ok() { - has_source = true; - break; - } - target = **parent; + while let Ok(parent) = parents.get(target) { + if sources.get(**parent).is_ok() { + has_source = true; + break; } + target = **parent; } if !has_source { commands.entity(entity).insert(Source::default());