16 lines
534 B
C#
16 lines
534 B
C#
using System.Numerics;
|
|
|
|
namespace Questionable.Controller.NavigationOverrides;
|
|
|
|
internal sealed record BlacklistedArea(ushort TerritoryId, Vector3 Center, float MinDistance, float MaxDistance, bool RecalculateNavmesh = false) : IBlacklistedLocation
|
|
{
|
|
public AlternateLocation? AdjustPoint(Vector3 point)
|
|
{
|
|
float num = (point - Center).Length();
|
|
if (num < MinDistance || num > MaxDistance)
|
|
{
|
|
return null;
|
|
}
|
|
return new AlternateLocation(Center + Vector3.Normalize(point - Center) * MaxDistance, RecalculateNavmesh);
|
|
}
|
|
}
|