Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assigning site IDs to new lanes in lifts #226

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading