Fixed loop condition in bone mapping

Corrected the for-loop condition in the auto_mapping_process function. Previously, it was checking if children.size() is non-zero, which resulted in an infinite loop

(cherry picked from commit 15f1a0fba3)
This commit is contained in:
K. S. Ernest (iFire) Lee 2024-03-29 07:22:17 -07:00 committed by Rémi Verschelde
parent 0177ddb144
commit e25abb5760
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -1138,7 +1138,7 @@ void BoneMapper::auto_mapping_process(Ref<BoneMap> &p_bone_map) {
children.erase(ls_idx);
children.erase(rs_idx);
String word = "spine"; // It would be better to limit the search with "spine" because it could be mistaken with breast, wing and etc...
for (int i = 0; children.size(); i++) {
for (int i = 0; i < children.size(); i++) {
bone_idx = children[i];
if (is_match_with_bone_name(skeleton->get_bone_name(bone_idx), word)) {
neck = bone_idx;