fix(Core/Instances): instance reset (#1416)
This commit is contained in:
committed by
Francesco Borzì
parent
275dbec76d
commit
6dfb40b446
@@ -291,13 +291,17 @@ void InstanceSaveManager::LoadResetTimes()
|
|||||||
SetResetTimeFor(mapid, difficulty, t);
|
SetResetTimeFor(mapid, difficulty, t);
|
||||||
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u', '%u', '%u')", mapid, difficulty, (uint32)t);
|
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u', '%u', '%u')", mapid, difficulty, (uint32)t);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (t < now)
|
||||||
{
|
{
|
||||||
// next reset should be in future. If its not, skip to future.
|
// assume that expired instances have already been cleaned
|
||||||
while (t < now)
|
// calculate the next reset time
|
||||||
t = uint32(((t + MINUTE) / DAY * DAY) + period + diff);
|
t = (t * DAY) / DAY;
|
||||||
|
t += ((today - t) / period + 1) * period + diff;
|
||||||
|
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '%u' WHERE mapid = '%u' AND difficulty = '%u'", (uint32)t, mapid, difficulty);
|
||||||
}
|
}
|
||||||
SetExtendedResetTimeFor(mapid, difficulty, t + period);
|
|
||||||
|
SetExtendedResetTimeFor(mapid, difficulty, t);
|
||||||
|
|
||||||
// schedule the global reset/warning
|
// schedule the global reset/warning
|
||||||
uint8 type;
|
uint8 type;
|
||||||
|
|||||||
Reference in New Issue
Block a user