diff options
| author | 2023-07-21 11:22:42 +0100 | |
|---|---|---|
| committer | 2023-07-21 11:22:42 +0100 | |
| commit | 1a746b2c7f4ef52cc8a5eea79f51ebaae3be022c (patch) | |
| tree | 135c12174d42a177a93ad27c886303831475bee1 /src/timer.cpp | |
| parent | Move 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.cpp | 7 |
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); } |
