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

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GameTime.h"
#include "InstanceScript.h"
#include "ScriptMgr.h"
#include "the_botanica.h"
@@ -163,7 +164,7 @@ public:
{
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
{
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > time(nullptr))
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime().count())
return false;
uint32 form = 0;
@@ -187,7 +188,7 @@ public:
if (form)
{
_swapTime = time(nullptr) + 6;
_swapTime = GameTime::GetGameTime().count() + 6;
_lastSchool = spellInfo->GetSchoolMask();
GetUnitOwner()->RemoveAurasDueToSpell(_lastForm);
_lastForm = form;