From 74d861b655181613d9f510bf255cda702b107aef Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Wed, 19 Jun 2024 11:59:13 +0800 Subject: [PATCH] Fix assigning site IDs to new lanes in lifts (#226) Signed-off-by: Luca Della Vedova --- rmf_site_editor/src/site/save.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rmf_site_editor/src/site/save.rs b/rmf_site_editor/src/site/save.rs index 1006a28c..5d574ff3 100644 --- a/rmf_site_editor/src/site/save.rs +++ b/rmf_site_editor/src/site/save.rs @@ -136,6 +136,8 @@ fn assign_site_ids(world: &mut World, site: Entity) -> Result<(), SiteGeneration ), >, Query<(), With>, + Query<&ChildCabinAnchorGroup>, + Query, Without)>, Query<&NextSiteID>, Query<&SiteID>, Query<&Children>, @@ -148,6 +150,8 @@ fn assign_site_ids(world: &mut World, site: Entity) -> Result<(), SiteGeneration lifts, drawing_children, drawings, + cabin_anchor_groups, + cabin_anchor_group_children, sites, site_ids, children, @@ -209,6 +213,17 @@ fn assign_site_ids(world: &mut World, site: Entity) -> Result<(), SiteGeneration } if let Ok(lift) = lifts.get(*site_child) { + if let Ok(anchor_group) = cabin_anchor_groups.get(*site_child) { + if let Ok(anchor_children) = children.get(**anchor_group) { + for anchor_child in anchor_children { + if let Ok(e) = cabin_anchor_group_children.get(*anchor_child) { + if !site_ids.contains(e) { + new_entities.push(e); + } + } + } + } + } if !site_ids.contains(lift) { new_entities.push(lift); }