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

@@ -23,6 +23,7 @@
#include "Vehicle.h"
#include "VMapFactory.h"
#include "LFGMgr.h"
#include "GameTime.h"
#include "Chat.h"
#ifdef ELUNA
#include "LuaEngine.h"
@@ -2648,7 +2649,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// increase current instances (hourly limit)
// xinef: specific instances are still limited
if (!group || !group->isLFGGroup() || !group->IsLfgRandomInstance())
player->AddInstanceEnterTime(GetInstanceId(), time(NULL));
player->AddInstanceEnterTime(GetInstanceId(), GameTime::GetGameTime());
if (!playerBind->perm && !mapSave->CanReset() && (!group || !group->isLFGGroup() || !group->IsLfgRandomInstance()))
{
@@ -2994,7 +2995,7 @@ void Map::SaveCreatureRespawnTime(uint32 dbGuid, time_t& respawnTime)
return;
}
time_t now = time(NULL);
time_t now = GameTime::GetGameTime();
if (GetInstanceResetPeriod() > 0 && respawnTime-now+5 >= GetInstanceResetPeriod())
respawnTime = now+YEAR;
@@ -3028,7 +3029,7 @@ void Map::SaveGORespawnTime(uint32 dbGuid, time_t& respawnTime)
return;
}
time_t now = time(NULL);
time_t now = GameTime::GetGameTime();
if (GetInstanceResetPeriod() > 0 && respawnTime-now+5 >= GetInstanceResetPeriod())
respawnTime = now+YEAR;