Core/Spells: fix wrong distance calculations in AoE spells

Port From (https://github.com/TrinityCore/TrinityCore/commit/5d076cfe291980bc5be9d44ffbae887e3dd5ad59)
This commit is contained in:
hondacrx
2020-05-06 14:34:20 -04:00
parent 95cca081de
commit ba885908b7
29 changed files with 202 additions and 118 deletions
@@ -173,7 +173,7 @@ namespace Game.Movement
float size = 0;
// Pets need special handling.
// We need to subtract GetObjectSize() because it gets added back further down the chain
// We need to subtract GetCombatReach() because it gets added back further down the chain
// and that makes pets too far away. Subtracting it allows pets to properly
// be (GetCombatReach() + i_offset) away.
// Only applies when i_target is pet's owner otherwise pets and mobs end up
@@ -181,12 +181,12 @@ namespace Game.Movement
if (owner.IsPet() && Target.IsTypeId(TypeId.Player))
{
dist = 1.0f;// target.GetCombatReach();
size = 1.0f;// target.GetCombatReach() - target.GetObjectSize();
size = 1.0f;// target.GetCombatReach() - target.GetCombatReach();
}
else
{
dist = offset + 1.0f;
size = owner.GetObjectSize();
size = owner.GetCombatReach();
}
if (Target.IsWithinDistInMap(owner, dist))
+2 -2
View File
@@ -359,7 +359,7 @@ namespace Game.Movement
float dist = 2 * moveTimeHalf * speedXY;
float max_height = -MoveSpline.ComputeFallElevation(moveTimeHalf, false, -speedZ);
_owner.GetNearPoint(_owner, out x, out y, out z, _owner.GetObjectSize(), dist, _owner.GetAngle(srcX, srcY) + MathFunctions.PI);
_owner.GetNearPoint(_owner, out x, out y, out z, _owner.GetCombatReach(), dist, _owner.GetAngle(srcX, srcY) + MathFunctions.PI);
MoveSplineInit init = new MoveSplineInit(_owner);
init.MoveTo(x, y, z);
@@ -383,7 +383,7 @@ namespace Game.Movement
float moveTimeHalf = (float)(speedZ / gravity);
float dist = 2 * moveTimeHalf * speedXY;
_owner.GetClosePoint(out x, out y, out z, _owner.GetObjectSize(), dist, angle);
_owner.GetClosePoint(out x, out y, out z, _owner.GetCombatReach(), dist, angle);
MoveJump(x, y, z, 0.0f, speedXY, speedZ);
}