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

This reverts commit 51b8773528.
This commit is contained in:
Nefertumm
2019-02-15 15:14:49 -03:00
committed by GitHub
parent 23e7ae6a2f
commit c15206fc15
108 changed files with 509 additions and 933 deletions

View File

@@ -9,7 +9,6 @@
#include "Log.h"
#include "WorldPacket.h"
#include "ObjectMgr.h"
#include "GameTime.h"
#include "SpellMgr.h"
#include "Pet.h"
#include "Formulas.h"
@@ -238,7 +237,7 @@ void Pet::SavePetToDB(PetSaveMode mode, bool logout)
stmt->setUInt32(12, curhealth);
stmt->setUInt32(13, curmana);
stmt->setUInt32(14, GetPower(POWER_HAPPINESS));
stmt->setUInt32(15, GameTime::GetGameTime());
stmt->setUInt32(15, time(NULL));
std::ostringstream ss;
for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i)
@@ -322,7 +321,7 @@ void Pet::Update(uint32 diff)
{
case CORPSE:
{
if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= GameTime::GetGameTime())
if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= time(NULL))
{
Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER!
return;
@@ -1060,7 +1059,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result)
if (result)
{
time_t curTime = GameTime::GetGameTime();
time_t curTime = time(NULL);
PacketCooldowns cooldowns;
WorldPacket data;
@@ -1106,8 +1105,8 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans, bool logout)
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
trans->Append(stmt);
time_t curTime = GameTime::GetGameTime();
uint32 checkTime = GameTime::GetGameTimeMS() + 30*IN_MILLISECONDS;
time_t curTime = time(NULL);
uint32 checkTime = World::GetGameTimeMS() + 30*IN_MILLISECONDS;
// remove oudated and save active
CreatureSpellCooldowns::iterator itr, itr2;
@@ -1115,11 +1114,11 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans, bool logout)
{
itr2 = itr;
++itr;
if (itr2->second <= GameTime::GetGameTimeMS()+1000)
if (itr2->second <= World::GetGameTimeMS()+1000)
m_CreatureSpellCooldowns.erase(itr2);
else if (logout || itr2->second > checkTime)
{
uint32 cooldown = ((itr2->second-GameTime::GetGameTimeMS())/IN_MILLISECONDS) + curTime;
uint32 cooldown = ((itr2->second-World::GetGameTimeMS())/IN_MILLISECONDS) + curTime;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL_COOLDOWN);
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
stmt->setUInt32(1, itr2->first);
@@ -2144,7 +2143,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
pet->SetFullHealth();
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime())); // cast can't be helped in this case
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
}
map->AddToMap(pet->ToCreature(), true);