From 6e6e296502ab2a72e1879fb23e076a0956f1aabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20=27dreamsComeTrue=27=20Jasi=C5=84ski?= Date: Tue, 24 Mar 2020 00:43:59 +0100 Subject: [PATCH] Set correct RW locks in AnimatedTexture --- scene/resources/texture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 4fdb7ca7fd8..837aa39ce19 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2692,7 +2692,7 @@ Ref AnimatedTexture::get_frame_texture(int p_frame) const { void AnimatedTexture::set_frame_duration(int p_frame, float p_duration) { ERR_FAIL_INDEX(p_frame, MAX_FRAMES); - RWLockRead r(rw_lock); + RWLockWrite r(rw_lock); frames[p_frame].duration = p_duration; } @@ -2708,6 +2708,8 @@ float AnimatedTexture::get_frame_duration(int p_frame) const { void AnimatedTexture::set_speed_scale(float p_scale) { ERR_FAIL_COND(p_scale < -1000 || p_scale >= 1000); + RWLockWrite r(rw_lock); + speed_scale = p_scale; }