Invert logic in build_bone_children_hierarchy.

pull/5007/head
Marc-Antoine Lortie 2023-03-14 09:21:45 -04:00
parent 25ab05eb49
commit eb3b48e523
1 changed files with 12 additions and 12 deletions

View File

@ -516,8 +516,9 @@ void HL1MDLLoader::read_bones() {
void HL1MDLLoader::build_bone_children_hierarchy(const TempBone &bone) void HL1MDLLoader::build_bone_children_hierarchy(const TempBone &bone)
{ {
if (bone.children.size() > 0) if (bone.children.empty())
{ return;
aiNode* bone_node = bone.node; aiNode* bone_node = bone.node;
bone_node->mNumChildren = static_cast<unsigned int>(bone.children.size()); bone_node->mNumChildren = static_cast<unsigned int>(bone.children.size());
bone_node->mChildren = new aiNode *[bone_node->mNumChildren]; bone_node->mChildren = new aiNode *[bone_node->mNumChildren];
@ -530,7 +531,6 @@ void HL1MDLLoader::build_bone_children_hierarchy(const TempBone &bone)
build_bone_children_hierarchy(child_bone); build_bone_children_hierarchy(child_bone);
} }
} }
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
/* /*