Prevent being able to set bone's parent as itself

This commit is contained in:
laws65 2021-09-23 11:30:45 +09:30
parent bfcc29635f
commit 59ff3fda7f

View File

@ -520,6 +520,7 @@ void Skeleton3D::set_bone_parent(int p_bone, int p_parent) {
const int bone_size = bones.size();
ERR_FAIL_INDEX(p_bone, bone_size);
ERR_FAIL_COND(p_parent != -1 && (p_parent < 0));
ERR_FAIL_COND(p_bone == p_parent);
bones.write[p_bone].parent = p_parent;
process_order_dirty = true;