mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
feat(Core/Time): Implement saparated manager for game time (#8630)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Common.h"
|
||||
#include "Config.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
@@ -93,7 +94,7 @@ InstanceSave* InstanceSaveMgr::AddInstanceSave(uint32 mapId, uint32 instanceId,
|
||||
}
|
||||
else
|
||||
{
|
||||
resetTime = time(nullptr) + 3 * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup
|
||||
resetTime = GameTime::GetGameTime().count() + 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);
|
||||
@@ -260,7 +261,7 @@ void InstanceSaveMgr::LoadInstances()
|
||||
|
||||
void InstanceSaveMgr::LoadResetTimes()
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
time_t now = GameTime::GetGameTime().count();
|
||||
time_t today = (now / DAY) * DAY;
|
||||
|
||||
// load the global respawn times for raid/heroic instances
|
||||
@@ -423,7 +424,7 @@ void InstanceSaveMgr::ScheduleReset(time_t time, InstResetEvent event)
|
||||
|
||||
void InstanceSaveMgr::Update()
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
time_t now = GameTime::GetGameTime().count();
|
||||
time_t t;
|
||||
bool resetOccurred = false;
|
||||
|
||||
@@ -522,7 +523,7 @@ void InstanceSaveMgr::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool
|
||||
if (!mapEntry->Instanceable())
|
||||
return;
|
||||
|
||||
time_t now = time(nullptr);
|
||||
time_t now = GameTime::GetGameTime().count();
|
||||
|
||||
if (!warn)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user