From c2aaf6bfcbced8ed369098eb980518ff749a083c Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 28 Apr 2010 22:07:58 +0200 Subject: Fix weekly reset time initialization. If timer in the past update to current time --HG-- branch : trunk --- src/game/World.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/game/World.cpp b/src/game/World.cpp index 71618582329..d4bc5e771f5 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -2501,19 +2501,9 @@ void World::_UpdateRealmCharCount(QueryResult_AutoPtr resultCharCount, uint32 ac void World::InitWeeklyQuestResetTime() { - time_t wtime = uint64(sWorld.getWorldState(WS_WEEKLY_QUEST_RESET_TIME)); - if (!wtime) - { - m_NextWeeklyQuestReset = time_t(m_gameTime + WEEK); - sWorld.setWorldState(WS_WEEKLY_QUEST_RESET_TIME, uint64(m_NextWeeklyQuestReset)); - } - else - { - // move to just before if need - time_t cur = time(NULL); - if (m_NextWeeklyQuestReset < cur) - m_NextWeeklyQuestReset += WEEK; - } + time_t wstime = uint64(sWorld.getWorldState(WS_WEEKLY_QUEST_RESET_TIME)); + time_t curtime = time(NULL); + m_NextWeeklyQuestReset = wstime < curtime ? curtime : time_t(wstime); } void World::InitDailyQuestResetTime() -- cgit v1.2.3