Update list ids immediately during body detach.

Fixes #2499.

PiperOrigin-RevId: 736449320
Change-Id: Ieeae52bdbbbb896d886221ab088229c8287a32a3
This commit is contained in:
Alessio Quaglino
2025-03-13 03:55:06 -07:00
committed by Copybara-Service
parent 8f4c5c4b16
commit 8e300eb628
2 changed files with 69 additions and 1 deletions
+4
View File
@@ -494,6 +494,10 @@ void mjCModel::RemoveFromList(std::vector<T*>& list, const mjCModel& other) {
removed++;
}
}
if (removed > 0 && !list.empty()) {
// if any elements were removed, update ids using processlist
processlist(ids, list, list[0]->elemtype, /*checkrepeat=*/false);
}
}