Skip to content

Commit 23a0dac

Browse files
committed
Merge pull request #96136 from SaracenOne/auto_mapper_fix
Prevent automapper throwing obscure error.
2 parents 93f241b + 3caba6e commit 23a0dac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

editor/plugins/bone_map_editor_plugin.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1229,9 +1229,11 @@ void BoneMapper::auto_mapping_process(Ref<BoneMap> &p_bone_map) {
12291229
picklist.push_back("face");
12301230
int head = search_bone_by_name(skeleton, picklist, BONE_SEGREGATION_NONE, neck);
12311231
if (head == -1) {
1232-
search_path = skeleton->get_bone_children(neck);
1233-
if (search_path.size() == 1) {
1234-
head = search_path[0]; // Maybe only one child of the Neck is Head.
1232+
if (neck != -1) {
1233+
search_path = skeleton->get_bone_children(neck);
1234+
if (search_path.size() == 1) {
1235+
head = search_path[0]; // Maybe only one child of the Neck is Head.
1236+
}
12351237
}
12361238
}
12371239
if (head == -1) {

0 commit comments

Comments
 (0)