summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-11-20 01:28:40 +0200
committerAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-11-20 01:28:40 +0200
commitafcb6f38db9c313328130b6632073cda7f3b98e0 (patch)
treec446b29005779b2a9ea4509da5e75ddd6b4315e4 /scene/main
parent9a3d3df0e2b98214cc208542834a51fbc16f6894 (diff)
Do not start `Timer` upon manual switching of internal process
Prevents `Timer` to prematurely start and timeout immediately if internal processing is enabled manually with `Timer.set_process_internal(true)` or `Timer.set_physics_process_internal(true)`. Even if the internal processing is enabled manually, the user still has to actually start the timer with `start()` method explicitly.
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/timer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index c9fce2f6c2..1c6037d26e 100644
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -46,7 +46,7 @@ void Timer::_notification(int p_what) {
}
} break;
case NOTIFICATION_INTERNAL_PROCESS: {
- if (timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal()) {
+ if (!processing || timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal()) {
return;
}
time_left -= get_process_delta_time();
@@ -63,7 +63,7 @@ void Timer::_notification(int p_what) {
} break;
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
- if (timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) {
+ if (!processing || timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) {
return;
}
time_left -= get_physics_process_delta_time();