diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-07-26 19:37:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 19:37:49 +0200 |
commit | a504e4d4c3af53bb21a0013132719affd3e21798 (patch) | |
tree | d7555c02d6f13f3df95dadb78669c1b1c47c6c17 /scene/main/timer.cpp | |
parent | db1603b805056a2b1087089829ab9bd6b2cfbd44 (diff) | |
parent | 4ecb6fba8002533f266d03e13ccba7cee4216421 (diff) |
Merge pull request #38880 from aaronfranke/timer
Use doubles for time everywhere in Timer/SceneTree
Diffstat (limited to 'scene/main/timer.cpp')
-rw-r--r-- | scene/main/timer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index ef8245076f..b5a2a30b3b 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -81,12 +81,12 @@ void Timer::_notification(int p_what) { } } -void Timer::set_wait_time(float p_time) { +void Timer::set_wait_time(double p_time) { ERR_FAIL_COND_MSG(p_time <= 0, "Time should be greater than zero."); wait_time = p_time; } -float Timer::get_wait_time() const { +double Timer::get_wait_time() const { return wait_time; } @@ -106,7 +106,7 @@ bool Timer::has_autostart() const { return autostart; } -void Timer::start(float p_time) { +void Timer::start(double p_time) { ERR_FAIL_COND_MSG(!is_inside_tree(), "Timer was not added to the SceneTree. Either add it or set autostart to true."); if (p_time > 0) { @@ -139,7 +139,7 @@ bool Timer::is_stopped() const { return get_time_left() <= 0; } -float Timer::get_time_left() const { +double Timer::get_time_left() const { return time_left > 0 ? time_left : 0; } |