mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 18:13:48 +00:00
feat(Core/Time): Implement saparated manager for game time (#8630)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "CharacterCache.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameTime.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Opcodes.h"
|
||||
@@ -30,13 +31,9 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type
|
||||
{
|
||||
m_objectType |= TYPEMASK_CORPSE;
|
||||
m_objectTypeId = TYPEID_CORPSE;
|
||||
|
||||
m_updateFlag = (UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION);
|
||||
|
||||
m_valuesCount = CORPSE_END;
|
||||
|
||||
m_time = time(nullptr);
|
||||
|
||||
m_time = GameTime::GetGameTime().count();
|
||||
lootRecipient = nullptr;
|
||||
}
|
||||
|
||||
@@ -195,3 +192,8 @@ bool Corpse::IsExpired(time_t t) const
|
||||
else
|
||||
return m_time < t - 3 * DAY;
|
||||
}
|
||||
|
||||
void Corpse::ResetGhostTime()
|
||||
{
|
||||
m_time = GameTime::GetGameTime().count();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(CORPSE_FIELD_OWNER); }
|
||||
|
||||
[[nodiscard]] time_t const& GetGhostTime() const { return m_time; }
|
||||
void ResetGhostTime() { m_time = time(nullptr); }
|
||||
void ResetGhostTime();
|
||||
[[nodiscard]] CorpseType GetType() const { return m_type; }
|
||||
|
||||
[[nodiscard]] CellCoord const& GetCellCoord() const { return _cellCoord; }
|
||||
|
||||
Reference in New Issue
Block a user