Core/Spells: Remade trajectory target selection
Port From (https://github.com/TrinityCore/TrinityCore/commit/3f7fe6f8a51f61083b4940eaadddc3b390f8e238)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user