diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2020-07-14 01:35:25 +0200 |
|---|---|---|
| committer | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-17 17:05:55 +0200 |
| commit | 896b68d5c297b06587645caebc98b704978ecaa7 (patch) | |
| tree | 14952aaccd9419ce4e67831e12c81b988fc280f5 /src/server/scripts/Spells | |
| parent | 235cdc2fd5c72e8dd8a91fb53a1b90babef24047 (diff) | |
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
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 12 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
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 |
