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)
This commit is contained in:
hondacrx
2021-01-03 15:10:14 -05:00
parent 031158b243
commit 15a69ae550
+3 -6
View File
@@ -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);