summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-11-17 12:13:45 +0000
committerSadie Powell <sadie@witchery.services>2024-11-18 00:48:50 +0000
commit7a20f26b84c7bb9ee59b896157de6e54adfd456a (patch)
treee4495e5db365699ecb1ca41da7757b454d2b10c1 /src
parent240f8b9e505af4888039769f5ce5a2388bdf228e (diff)
Only auto-add timers if they actually have a tick time.
Diffstat (limited to 'src')
-rw-r--r--src/timers.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/timers.cpp b/src/timers.cpp
index d9164bda7..64adbfdef 100644
--- a/src/timers.cpp
+++ b/src/timers.cpp
@@ -16,7 +16,8 @@ Timer::Timer(time_t time_from_now, bool repeating)
, secs(time_from_now)
, repeat(repeating)
{
- TimerManager::AddTimer(this);
+ if (time_from_now)
+ TimerManager::AddTimer(this);
}
Timer::Timer(Module *creator, time_t time_from_now, bool repeating)
@@ -25,7 +26,8 @@ Timer::Timer(Module *creator, time_t time_from_now, bool repeating)
, secs(time_from_now)
, repeat(repeating)
{
- TimerManager::AddTimer(this);
+ if (time_from_now)
+ TimerManager::AddTimer(this);
}
Timer::~Timer()