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

@@ -6,6 +6,7 @@
#include "Common.h"
#include "Corpse.h"
#include "GameTime.h"
#include "Player.h"
#include "UpdateMask.h"
#include "ObjectAccessor.h"
@@ -23,7 +24,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type
m_valuesCount = CORPSE_END;
m_time = time(NULL);
m_time = GameTime::GetGameTime();
lootRecipient = NULL;
}
@@ -132,6 +133,11 @@ void Corpse::DeleteFromDB(SQLTransaction& trans)
trans->Append(stmt);
}
void Corpse::ResetGhostTime()
{
m_time = GameTime::GetGameTime();
}
bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
{
uint32 ownerGuid = fields[17].GetUInt32();

View File

@@ -54,7 +54,7 @@ class Corpse : public WorldObject, public GridObject<Corpse>
uint64 GetOwnerGUID() const { return GetUInt64Value(CORPSE_FIELD_OWNER); }
time_t const& GetGhostTime() const { return m_time; }
void ResetGhostTime() { m_time = time(NULL); }
void ResetGhostTime();
CorpseType GetType() const { return m_type; }
GridCoord const& GetGridCoord() const { return _gridCoord; }