Core/Spells: Remade trajectory target selection

Port From (https://github.com/TrinityCore/TrinityCore/commit/3f7fe6f8a51f61083b4940eaadddc3b390f8e238)
This commit is contained in:
hondacrx
2019-08-15 11:51:44 -04:00
parent ee098676c2
commit bab0bbdf3c
8 changed files with 109 additions and 137 deletions
+2 -1
View File
@@ -288,11 +288,12 @@ namespace Game.Entities
return ((angle >= lborder) && (angle <= rborder));
}
public bool HasInLine(Position pos, float width)
public bool HasInLine(Position pos, float objSize, float width)
{
if (!HasInArc(MathFunctions.PI, pos))
return false;
width += objSize;
float angle = GetRelativeAngle(pos);
return Math.Abs(Math.Sin(angle)) * GetExactDist2d(pos.GetPositionX(), pos.GetPositionY()) < width;
}