feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)

i.e. world update start
This commit is contained in:
Viste(Кирилл)
2019-02-14 21:22:17 +03:00
committed by Francesco Borzì
parent 1b7522ff0e
commit 51b8773528
108 changed files with 933 additions and 509 deletions

View File

@@ -20,6 +20,7 @@
#include "ObjectMgr.h"
#include "World.h"
#include "Group.h"
#include "GameTime.h"
#include "InstanceScript.h"
#include "ScriptMgr.h"
@@ -77,7 +78,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
}
else
{
resetTime = time(NULL) + 3*DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup
resetTime = GameTime::GetGameTime() + 3*DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup
extendedResetTime = 0;
}
InstanceSave* save = new InstanceSave(mapId, instanceId, difficulty, resetTime, extendedResetTime);
@@ -239,7 +240,7 @@ void InstanceSaveManager::LoadInstances()
void InstanceSaveManager::LoadResetTimes()
{
time_t now = time(NULL);
time_t now = GameTime::GetGameTime();
time_t today = (now / DAY) * DAY;
// load the global respawn times for raid/heroic instances
@@ -400,7 +401,7 @@ void InstanceSaveManager::ScheduleReset(time_t time, InstResetEvent event)
void InstanceSaveManager::Update()
{
time_t now = time(NULL);
time_t now = GameTime::GetGameTime();
time_t t;
bool resetOccurred = false;
@@ -499,7 +500,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
if (!mapEntry->Instanceable())
return;
time_t now = time(NULL);
time_t now = GameTime::GetGameTime();
if (!warn)
{