feat(Core/Time): Implement saparated manager for game time (#8630)

This commit is contained in:
Kargatum
2022-01-24 17:55:00 +07:00
committed by GitHub
parent 12da792a90
commit 8b7df23f06
129 changed files with 1147 additions and 817 deletions

View File

@@ -16,6 +16,7 @@
*/
#include "blackrock_depths.h"
#include "GameTime.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
@@ -154,7 +155,7 @@ public:
{
if (InstanceScript* instance = player->GetInstanceScript())
{
time_t now = time(nullptr);
time_t now = GameTime::GetGameTime().count();
if (instance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || instance->GetData(TYPE_RING_OF_LAW) == DONE)
{
return false;

View File

@@ -15,12 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GameTime.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "blackrock_depths.h"
#define MAX_ENCOUNTER 6
constexpr auto MAX_ENCOUNTER = 6;
enum Timers
{
@@ -462,7 +463,7 @@ public:
{
TempSummonGrimstone->RemoveFromWorld();
TempSummonGrimstone = nullptr;
timeRingFail = time(nullptr);
timeRingFail = GameTime::GetGameTime().count();
}
SetData(TYPE_RING_OF_LAW, NOT_STARTED);
break;