mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Fix weekly reset time initialization.
If timer in the past update to current time --HG-- branch : trunk
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user