diff --git a/include/timers.h b/include/timers.h index 71ab8a153..28d5a9a10 100644 --- a/include/timers.h +++ b/include/timers.h @@ -90,7 +90,7 @@ class CoreExport Timer : public Extensible */ class CoreExport TimerManager : public Extensible { - protected: + friend class Timer; /** A list of timers */ static std::vector Timers; diff --git a/src/timers.cpp b/src/timers.cpp index 0a40106d6..a8cef007b 100644 --- a/src/timers.cpp +++ b/src/timers.cpp @@ -72,6 +72,8 @@ time_t Timer::GetSetTime() const void Timer::SetSecs(time_t t) { secs = t; + trigger = Anope::CurTime + t; + sort(TimerManager::Timers.begin(), TimerManager::Timers.end(), TimerManager::TimerComparison); } /** Returns the interval between ticks