From e25abb57603d896109841c71190cfaf6f20fef3e Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Fri, 29 Mar 2024 07:22:17 -0700 Subject: [PATCH] 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 15f1a0fba3c8e576f83427b686ee49291d4e4eff) --- editor/plugins/bone_map_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index 411d7100ec3..93493577f0b 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -1138,7 +1138,7 @@ void BoneMapper::auto_mapping_process(Ref &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;