mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Merge commit godotengine/godot@e1b4101e34
This commit is contained in:
@@ -305,6 +305,8 @@ Ref<Tween> Tween::chain() {
|
||||
}
|
||||
|
||||
bool Tween::custom_step(double p_delta) {
|
||||
ERR_FAIL_COND_V_MSG(in_step, true, "Can't call custom_step() during another Tween step.");
|
||||
|
||||
bool r = running;
|
||||
running = true;
|
||||
bool ret = step(p_delta);
|
||||
@@ -331,6 +333,7 @@ bool Tween::step(double p_delta) {
|
||||
if (!running) {
|
||||
return true;
|
||||
}
|
||||
in_step = true;
|
||||
|
||||
if (!started) {
|
||||
if (tweeners.is_empty()) {
|
||||
@@ -341,6 +344,7 @@ bool Tween::step(double p_delta) {
|
||||
} else {
|
||||
tween_id = to_string();
|
||||
}
|
||||
in_step = false;
|
||||
ERR_FAIL_V_MSG(false, tween_id + ": started with no Tweeners.");
|
||||
}
|
||||
current_step = 0;
|
||||
@@ -359,7 +363,7 @@ bool Tween::step(double p_delta) {
|
||||
bool potential_infinite = false;
|
||||
#endif
|
||||
|
||||
while (rem_delta > 0 && running) {
|
||||
while (running && rem_delta > 0) {
|
||||
double step_delta = rem_delta;
|
||||
step_active = false;
|
||||
|
||||
@@ -394,6 +398,7 @@ bool Tween::step(double p_delta) {
|
||||
potential_infinite = true;
|
||||
} else {
|
||||
// Looped twice without using any time, this is 100% certain infinite loop.
|
||||
in_step = false;
|
||||
ERR_FAIL_V_MSG(false, "Infinite loop detected. Check set_loops() description for more info.");
|
||||
}
|
||||
}
|
||||
@@ -404,7 +409,7 @@ bool Tween::step(double p_delta) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
in_step = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ private:
|
||||
bool is_bound = false;
|
||||
bool started = false;
|
||||
bool running = true;
|
||||
bool in_step = false;
|
||||
bool dead = false;
|
||||
bool valid = false;
|
||||
bool default_parallel = false;
|
||||
|
||||
Reference in New Issue
Block a user