summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-01-03 17:27:13 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-01-03 17:27:31 -0300
commitcd63407aa40e060631334b307e9ab4273ff90e39 (patch)
treee860848dfea38ced813367e8e11c67f5465f76f5 /scene
parent16a49cca04338a58a2f729e58ce81a875bd76067 (diff)
Avoid crashes in skeleton
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/skeleton.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index ef60a2151d..aaa378bb68 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;