Return attached body/frame in mjs_attachBody/Frame.

PiperOrigin-RevId: 679601525
Change-Id: Icdc4616808e14bf0a3ebc17d89392382d084c31b
This commit is contained in:
Alessio Quaglino
2024-09-27 08:32:52 -07:00
committed by Copybara-Service
parent 176345b4e1
commit 25e4d75a07
11 changed files with 67 additions and 45 deletions
+2 -2
View File
@@ -3627,7 +3627,7 @@ void mjXReader::Body(XMLElement* section, mjsBody* body, mjsFrame* frame,
UpdateString(suffix, count, i);
// attach to parent
if (mjs_attachFrame(body, pframe, /*prefix=*/"", suffix.c_str()) != 0) {
if (!mjs_attachFrame(body, pframe, /*prefix=*/"", suffix.c_str())) {
throw mjXError(elem, mjs_getError(spec));
}
}
@@ -3704,7 +3704,7 @@ void mjXReader::Body(XMLElement* section, mjsBody* body, mjsFrame* frame,
if (!child) {
throw mjXError(0, "could not find body '%s''%s'", body_name.c_str());
}
if (mjs_attachBody(pframe, child, prefix.c_str(), "") != 0) {
if (!mjs_attachBody(pframe, child, prefix.c_str(), "")) {
throw mjXError(elem, mjs_getError(spec));
}
} else {