From 49ee4d3b67026d284ba391dd4688b6ce3616f221 Mon Sep 17 00:00:00 2001 From: Nova Date: Thu, 1 May 2025 02:59:25 -0700 Subject: [PATCH] fix(zones): don't add ancestors of zone to be captured --- src/nodes/spatial/zone.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nodes/spatial/zone.rs b/src/nodes/spatial/zone.rs index 9f45391..5bfabe7 100644 --- a/src/nodes/spatial/zone.rs +++ b/src/nodes/spatial/zone.rs @@ -80,6 +80,11 @@ impl Zone { let current_zoneables = Registry::new(); for zoneable in ZONEABLE_REGISTRY.get_valid_contents() { + // Skip if the zoneable is an ancestor of the zone or the zone itself + if zoneable.is_ancestor_of(self.spatial.clone()) { + continue; + } + let distance = self.field.distance(&zoneable, [0.0; 3].into()); if distance > 0.0 { continue;