aboutsummaryrefslogtreecommitdiff
path: root/src/timer.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-07-21 11:22:42 +0100
committerGravatar Sadie Powell2023-07-21 11:22:42 +0100
commit1a746b2c7f4ef52cc8a5eea79f51ebaae3be022c (patch)
tree135c12174d42a177a93ad27c886303831475bee1 /src/timer.cpp
parentMove checks for whether a user is cloakable to {Get,Reset}Cloaks. (diff)
Allow timers to not be restarted after changing the interval.
This is useful if you're changing them from Tick.
Diffstat (limited to 'src/timer.cpp')
-rw-r--r--src/timer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/timer.cpp b/src/timer.cpp
index c5d7f3ea3..c28a981ea 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -26,10 +26,13 @@
#include "inspircd.h"
-void Timer::SetInterval(unsigned long newinterval)
+void Timer::SetInterval(unsigned long newinterval, bool restart)
{
- ServerInstance->Timers.DelTimer(this);
secs = newinterval;
+ if (!restart)
+ return;
+
+ ServerInstance->Timers.DelTimer(this);
SetTrigger(ServerInstance->Time() + newinterval);
ServerInstance->Timers.AddTimer(this);
}