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

@@ -17,7 +17,6 @@ EndScriptData */
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "GameTime.h"
#include "ScriptMgr.h"
class ban_commandscript : public CommandScript
@@ -246,7 +245,7 @@ public:
time_t unbanDate = time_t(fields[3].GetUInt32());
bool active = false;
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= GameTime::GetGameTime()))
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(nullptr)))
active = true;
bool permanent = (fields[1].GetUInt64() == uint64(0));
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
@@ -294,7 +293,7 @@ public:
Field* fields = result->Fetch();
time_t unbanDate = time_t(fields[3].GetUInt32());
bool active = false;
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= GameTime::GetGameTime()))
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(nullptr)))
active = true;
bool permanent = (fields[1].GetUInt32() == uint32(0));
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);