From cd63407aa40e060631334b307e9ab4273ff90e39 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 3 Jan 2018 17:27:13 -0300 Subject: [PATCH] Avoid crashes in skeleton --- scene/3d/skeleton.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index ef60a2151d4..aaa378bb682 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -160,14 +160,14 @@ void Skeleton::_notification(int p_what) { //if moved, just update transforms VisualServer *vs = VisualServer::get_singleton(); - Bone *bonesptr = &bones[0]; + const Bone *bonesptr = bones.ptr(); int len = bones.size(); Transform global_transform = get_global_transform(); Transform global_transform_inverse = global_transform.affine_inverse(); for (int i = 0; i < len; i++) { - Bone &b = bonesptr[i]; + const Bone &b = bonesptr[i]; vs->skeleton_bone_set_transform(skeleton, i, global_transform * (b.transform_final * global_transform_inverse)); } } break;