summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2011-06-09 06:16:31 +0200
committerDukePyrolator <DukePyrolator@anope.org>2011-06-09 06:16:31 +0200
commit717b4c3406a8247561de8d36526bb7c32a7af4e7 (patch)
tree624b9598b8ec3a44cb6c979289bf24554f3b3fb3
parent74361bec0586466bda872d2d846a768d95d6cd5f (diff)
small improvement for Timer::SetSecs()
-rw-r--r--include/timers.h2
-rw-r--r--src/timers.cpp2
2 files changed, 3 insertions, 1 deletions
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<Timer *> 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