From cab6c04d6f8ae987e591301161f0bd05014e9d31 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 4 Mar 2019 20:41:31 +0100 Subject: [PATCH] Core/Spells: fixed calculating additional ticks from haste --- src/server/game/Spells/Spell.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index cd471dfab74..c7da0abc902 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2801,7 +2801,10 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (AuraEffect const* eff = m_spellAura->GetEffect(i)) if (int32 amplitude = eff->GetAmplitude()) // amplitude is hastened by UNIT_MOD_CAST_SPEED - duration = std::max(std::max(origDuration / amplitude, 1) * amplitude, duration); + { + int32 ticks = origDuration / amplitude + (origDuration % amplitude > amplitude / 2 ? 1 : 0); + duration = std::max(ticks * amplitude, duration); + } // if there is no periodic effect if (!duration)