fix(zones): don't add ancestors of zone to be captured

This commit is contained in:
Nova
2025-05-01 02:59:25 -07:00
parent c2f1f737a0
commit 49ee4d3b67

View File

@@ -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;