aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpp <none@none>2010-04-28 22:07:58 +0200
committerSpp <none@none>2010-04-28 22:07:58 +0200
commitc2aaf6bfcbced8ed369098eb980518ff749a083c (patch)
tree41523fb151f96bc59a436c492f283bd1df04ed21
parent6014f6e583fc387a93d7e783ea03178c9e955e07 (diff)
Fix weekly reset time initialization.
If timer in the past update to current time --HG-- branch : trunk
-rw-r--r--src/game/World.cpp16
1 files changed, 3 insertions, 13 deletions
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()