From 896b68d5c297b06587645caebc98b704978ecaa7 Mon Sep 17 00:00:00 2001 From: Treeston Date: Tue, 14 Jul 2020 01:35:25 +0200 Subject: Core/Time: Rename GetGameTime{System, Steady}Point methods The names are a bit unhandy. Rename them (shorter but still meaningful). GetGameTimeSystemPoint() -> GetSystemTime() GetGameTimeSteadyPoint() -> Now() Also add 2 new typedefs: typedef std::chrono::steady_clock::time_point TimePoint; typedef std::chrono::system_clock::time_point SystemTimePoint; Closes #25042 --- src/server/scripts/Spells/spell_druid.cpp | 12 ++++++------ src/server/scripts/Spells/spell_paladin.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 94c027853a4..1a2ffaec917 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -228,7 +228,7 @@ class spell_dru_eclipse : public AuraScript if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 4)) // Starfire return false; - return _solarProcCooldownEnd <= GameTime::GetGameTimeSteadyPoint(); + return _solarProcCooldownEnd <= GameTime::Now(); } bool CheckLunar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) @@ -241,14 +241,14 @@ class spell_dru_eclipse : public AuraScript if (!roll_chance_i(60)) return false; - return _lunarProcCooldownEnd <= GameTime::GetGameTimeSteadyPoint(); + return _lunarProcCooldownEnd <= GameTime::Now(); } void ProcSolar(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - _solarProcCooldownEnd = GameTime::GetGameTimeSteadyPoint() + Seconds(30); + _solarProcCooldownEnd = GameTime::Now() + 30s; eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_SOLAR_PROC, aurEff); } @@ -256,7 +256,7 @@ class spell_dru_eclipse : public AuraScript { PreventDefaultAction(); - _lunarProcCooldownEnd = GameTime::GetGameTimeSteadyPoint() + Seconds(30); + _lunarProcCooldownEnd = GameTime::Now() + 30s; eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, aurEff); } @@ -271,8 +271,8 @@ class spell_dru_eclipse : public AuraScript OnEffectProc += AuraEffectProcFn(spell_dru_eclipse::ProcLunar, EFFECT_1, SPELL_AURA_DUMMY); } - std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); - std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); + TimePoint _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); + TimePoint _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); }; // 5229 - Enrage diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 20b942d5ba1..228ed4a74bb 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1992,7 +1992,7 @@ class spell_pal_sacred_shield_dummy : public SpellScriptLoader if (!caster) return; - std::chrono::steady_clock::time_point now = GameTime::GetGameTimeSteadyPoint(); + TimePoint now = GameTime::Now(); if (_cooldownEnd > now) return; @@ -2010,7 +2010,7 @@ class spell_pal_sacred_shield_dummy : public SpellScriptLoader } // Cooldown tracking can't be done in DB because of T8 bonus - std::chrono::steady_clock::time_point _cooldownEnd = std::chrono::steady_clock::time_point::min(); + TimePoint _cooldownEnd = std::chrono::steady_clock::time_point::min(); }; AuraScript* GetAuraScript() const override -- cgit v1.2.3