From 15a69ae550688cb1d040c63b488c458026cb6143 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 3 Jan 2021 15:10:14 -0500 Subject: [PATCH] Core/Spells: Core/Spells: Improve teleport destination for a certain class of spells (Killing Spree, Shadowstep, ...) Port From (https://github.com/TrinityCore/TrinityCore/commit/540678be069b24664ad95f1922288d026b7e0e41) --- Source/Game/Spells/Spell.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 5fe483fe3..7a2309938 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -953,12 +953,9 @@ namespace Game.Spells if (effect != null) { float angle = targetType.CalcDirectionAngle(); - float objSize = target.GetCombatReach(); - float dist = effect.CalcRadius(m_caster); - if (dist < objSize) - dist = objSize; - else if (targetType.GetTarget() == Targets.DestRandom) - dist = objSize + (dist - objSize) * (float)RandomHelper.NextDouble(); + float dist = effect.CalcRadius(null); + if (targetType.GetTarget() == Targets.DestRandom) + dist *= (float)RandomHelper.NextDouble(); Position pos = dest.Position; target.MovePositionToFirstCollision(ref pos, dist, angle);