From 5ead47b73310e936444ffbf005fb894a902cf67c Mon Sep 17 00:00:00 2001 From: Kargatum Date: Mon, 24 Jan 2022 17:56:08 +0700 Subject: [PATCH] feat(Time): add support GameTime (#16) --- GlobalMethods.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index 043494a..8ff1436 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -12,6 +12,7 @@ #ifdef AZEROTHCORE #include "BanMgr.h" +#include "GameTime.h" enum BanMode { @@ -158,6 +159,8 @@ namespace LuaGlobalFunctions { #ifdef TRINITY Eluna::Push(L, GameTime::GetGameTime()); +#elif AZEROTHCORE + Eluna::Push(L, GameTime::GetGameTime().count()); #else Eluna::Push(L, eWorld->GetGameTime()); #endif @@ -1940,7 +1943,7 @@ namespace LuaGlobalFunctions if (!items || items->Empty()) return 0; - auto const itemlist = items->m_items; + auto const& itemlist = items->m_items; for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr) #if defined(CATA) || defined(MISTS) eObjectMgr->RemoveVendorItem(entry, (*itr)->item, 1);