summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-30 12:46:20 +0200
committerGitHub <noreply@github.com>2017-08-30 12:46:20 +0200
commit7609efe7571733a38a4c372d9c69ea9c71601936 (patch)
treeace0ebdf8d483cbc2c8aa70fb21dc250f167140d
parentfd7ad7d80a9cfd6dd02b47d9c4a99d43cb044b27 (diff)
parent023b68542f39583981be176a2229a1e886335d52 (diff)
Merge pull request #10746 from cryptonaut/issue9187-3.0
Cleaned up logic in Tween::_tween_process(), fixes #9187 (3.0)
-rw-r--r--scene/animation/tween.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index 3cd953773f..fb61c43d5c 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -560,12 +560,16 @@ void Tween::_tween_process(float p_delta) {
switch (data.type) {
case INTER_PROPERTY:
- case INTER_METHOD:
- break;
+ case INTER_METHOD: {
+ Variant result = _run_equation(data);
+ emit_signal("tween_step", object, data.key, data.elapsed, result);
+ _apply_tween_value(data, result);
+ if (data.finish)
+ _apply_tween_value(data, data.final_val);
+ } break;
+
case INTER_CALLBACK:
if (data.finish) {
-
- Variant::CallError error;
if (data.call_deferred) {
switch (data.args) {
@@ -588,8 +592,8 @@ void Tween::_tween_process(float p_delta) {
object->call_deferred(data.key, data.arg[0], data.arg[1], data.arg[2], data.arg[3], data.arg[4]);
break;
}
-
} else {
+ Variant::CallError error;
Variant *arg[5] = {
&data.arg[0],
&data.arg[1],
@@ -599,19 +603,11 @@ void Tween::_tween_process(float p_delta) {
};
object->call(data.key, (const Variant **)arg, data.args, error);
}
- if (!repeat)
- call_deferred("_remove", object, data.key, true);
}
- continue;
+ break;
}
- Variant result = _run_equation(data);
- emit_signal("tween_step", object, data.key, data.elapsed, result);
-
- _apply_tween_value(data, result);
-
if (data.finish) {
- _apply_tween_value(data, data.final_val);
emit_signal("tween_completed", object, data.key);
// not repeat mode, remove completed action
if (!repeat)