diff options
| author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-14 20:46:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-14 20:46:18 +0200 |
| commit | bd837d4c3dc61e7817ccb14071108e97db86f1f5 (patch) | |
| tree | f53d258de354cbd9d35c1d02c2f0926cd9522d83 /src | |
| parent | d4bce9f4d2d6059740e5bcc146ffa8d98f715d6f (diff) | |
Core/CombatAI: Use std::chrono::duration overloads of EventMap (#25037)
Contributes to #25012
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/AI/CoreAI/CombatAI.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index b05e8436df9..b652f50fd3f 100644 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -80,7 +80,7 @@ void CombatAI::JustEngagedWith(Unit* who) if (AISpellInfo[spell].condition == AICOND_AGGRO) me->CastSpell(who, spell, false); else if (AISpellInfo[spell].condition == AICOND_COMBAT) - Events.ScheduleEvent(spell, AISpellInfo[spell].cooldown + rand32() % AISpellInfo[spell].cooldown); + Events.ScheduleEvent(spell, Milliseconds(AISpellInfo[spell].cooldown + rand32() % AISpellInfo[spell].cooldown)); } } @@ -97,7 +97,7 @@ void CombatAI::UpdateAI(uint32 diff) if (uint32 spellId = Events.ExecuteEvent()) { DoCast(spellId); - Events.ScheduleEvent(spellId, AISpellInfo[spellId].cooldown + rand32() % AISpellInfo[spellId].cooldown); + Events.ScheduleEvent(spellId, Milliseconds(AISpellInfo[spellId].cooldown + rand32() % AISpellInfo[spellId].cooldown)); } else DoMeleeAttackIfReady(); @@ -105,7 +105,7 @@ void CombatAI::UpdateAI(uint32 diff) void CombatAI::SpellInterrupted(uint32 spellId, uint32 unTimeMs) { - Events.RescheduleEvent(spellId, unTimeMs); + Events.RescheduleEvent(spellId, Milliseconds(unTimeMs)); } ///////////////// @@ -145,7 +145,7 @@ void CasterAI::JustEngagedWith(Unit* who) DoCast(Spells[spell]); cooldown += me->GetCurrentSpellCastTime(*itr); } - Events.ScheduleEvent(*itr, cooldown); + Events.ScheduleEvent(*itr, Milliseconds(cooldown)); } } } @@ -170,7 +170,7 @@ void CasterAI::UpdateAI(uint32 diff) { DoCast(spellId); uint32 casttime = me->GetCurrentSpellCastTime(spellId); - Events.ScheduleEvent(spellId, (casttime ? casttime : 500) + GetAISpellInfo(spellId)->realCooldown); + Events.ScheduleEvent(spellId, (casttime ? Milliseconds(casttime) : 500ms) + Milliseconds(GetAISpellInfo(spellId)->realCooldown)); } } |
