summaryrefslogtreecommitdiff
path: root/scene/main/timer.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-03 18:35:20 +0200
committerGitHub <noreply@github.com>2019-09-03 18:35:20 +0200
commit750f8d4926edb14269d9f6a117c5a9fd4765373a (patch)
treec813e0fb3d62ae67be4d8a3b091b68fc00a59344 /scene/main/timer.cpp
parent86c930998bc5620edb04df492117aa6f5e410a2e (diff)
parent5e337b31ebcf4509e1cf4cb64b02908ade59df05 (diff)
Merge pull request #31844 from 2shady4u/TweenInSceneTree
Timer and Tween check if they are in SceneTree when starting
Diffstat (limited to 'scene/main/timer.cpp')
-rwxr-xr-xscene/main/timer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index 03d46fd28d..14cc705edb 100755
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -107,6 +107,9 @@ bool Timer::has_autostart() const {
}
void Timer::start(float p_time) {
+
+ ERR_FAIL_COND_MSG(!is_inside_tree(), "Timer was not added to the SceneTree!");
+
if (p_time > 0) {
set_wait_time(p_time);
}