diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index f9666a48537..72b31170ea9 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -81,7 +81,7 @@ void Tween::_start_tweeners() { ERR_FAIL_MSG("Tween without commands, aborting."); } - for (Ref &tweener : tweeners.write[current_step]) { + for (Ref &tweener : tweeners[current_step]) { tweener->start(); } } @@ -179,7 +179,7 @@ void Tween::append(Ref p_tweener) { parallel_enabled = default_parallel; tweeners.resize(current_step + 1); - tweeners.write[current_step].push_back(p_tweener); + tweeners[current_step].push_back(p_tweener); } void Tween::stop() { @@ -365,7 +365,7 @@ bool Tween::step(double p_delta) { double step_delta = rem_delta; step_active = false; - for (Ref &tweener : tweeners.write[current_step]) { + for (Ref &tweener : tweeners[current_step]) { // Modified inside Tweener.step(). double temp_delta = rem_delta; // Turns to true if any Tweener returns true (i.e. is still not finished). @@ -379,7 +379,7 @@ bool Tween::step(double p_delta) { emit_signal(SNAME("step_finished"), current_step); current_step++; - if (current_step == tweeners.size()) { + if (current_step == (int)tweeners.size()) { loops_done++; if (loops_done == loops) { running = false; diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 8238cd8633d..ef82be9a2da 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -111,7 +111,7 @@ private: ObjectID bound_node; SceneTree *parent_tree = nullptr; - Vector>> tweeners; + LocalVector>> tweeners; double total_time = 0; int current_step = -1; int loops = 1;