Skip to content

Commit

Permalink
Fix assigning site IDs to new lanes in lifts (#226)
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
  • Loading branch information
luca-della-vedova committed Jun 19, 2024
1 parent 66c1603 commit 74d861b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rmf_site_editor/src/site/save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ fn assign_site_ids(world: &mut World, site: Entity) -> Result<(), SiteGeneration
),
>,
Query<(), With<DrawingMarker>>,
Query<&ChildCabinAnchorGroup>,
Query<Entity, (With<Anchor>, Without<Pending>)>,
Query<&NextSiteID>,
Query<&SiteID>,
Query<&Children>,
Expand All @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 74d861b

Please sign in to comment.