Skip to content

Commit

Permalink
[12337] More check on raid reset loading. If db reset time is corrupt…
Browse files Browse the repository at this point in the history
…ed and/or set in far future it was never been updated.
  • Loading branch information
Cyberium committed Jan 20, 2013
1 parent 8dfe066 commit 0a9b10e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/game/MapPersistentStateMgr.cpp
Expand Up @@ -343,6 +343,7 @@ void DungeonResetScheduler::LoadResetTimes()
{
time_t now = time(NULL);
time_t today = (now / DAY) * DAY;
time_t nextWeek = today + (7 * DAY);

// NOTE: Use DirectPExecute for tables that will be queried later

Expand Down Expand Up @@ -469,7 +470,7 @@ void DungeonResetScheduler::LoadResetTimes()
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','%u','" UI64FMTD "')", mapid, difficulty, (uint64)t);
}

if (t < now)
if (t < now || t > nextWeek)
{
// assume that expired instances have already been cleaned
// calculate the next reset time
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12336"
#define REVISION_NR "12337"
#endif // __REVISION_NR_H__

0 comments on commit 0a9b10e

Please sign in to comment.