Do not skip mjSpec's with repeated model names when attaching a new mjSpec.
PiperOrigin-RevId: 744705838 Change-Id: Ie47a3c029f443910629619b7f9ff43ab07646725
This commit is contained in:
committed by
Copybara-Service
parent
58234b2217
commit
d7027fb1c0
@@ -916,7 +916,7 @@ mjCBody& mjCBody::operator+=(const mjCBody& other) {
|
||||
// attach frame to body
|
||||
mjCBody& mjCBody::operator+=(const mjCFrame& other) {
|
||||
// append a copy of the attached spec
|
||||
if (other.model != model && !model->FindSpec(mjs_getString(other.model->spec.modelname))) {
|
||||
if (other.model != model && !model->FindSpec(&other.model->spec.compiler)) {
|
||||
model->AppendSpec(mj_copySpec(&other.model->spec), &other.model->spec.compiler);
|
||||
}
|
||||
|
||||
@@ -2029,7 +2029,7 @@ mjCFrame& mjCFrame::operator=(const mjCFrame& other) {
|
||||
// attach body to frame
|
||||
mjCFrame& mjCFrame::operator+=(const mjCBody& other) {
|
||||
// append a copy of the attached spec
|
||||
if (other.model != model && !model->FindSpec(mjs_getString(other.model->spec.modelname))) {
|
||||
if (other.model != model && !model->FindSpec(&other.model->spec.compiler)) {
|
||||
model->AppendSpec(mj_copySpec(&other.model->spec), &other.model->spec.compiler);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user