diff --git a/Source/Game/Maps/AreaBoundary.cs b/Source/Game/Maps/AreaBoundary.cs index 6c3278e83..6ce97b2f7 100644 --- a/Source/Game/Maps/AreaBoundary.cs +++ b/Source/Game/Maps/AreaBoundary.cs @@ -2,6 +2,7 @@ // Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information. using Game.Entities; +using System.Collections.Generic; namespace Game.Maps { @@ -133,7 +134,7 @@ namespace Game.Maps _a = new DoublePosition(pointA); _b = new DoublePosition(pointB); _c = new DoublePosition(pointC); - + _abx = _b.GetDoublePositionX() - _a.GetDoublePositionX(); _bcx = _c.GetDoublePositionX() - _b.GetDoublePositionX(); _cax = _a.GetDoublePositionX() - _c.GetDoublePositionX(); @@ -218,6 +219,23 @@ namespace Game.Maps float _maxZ; } + class PolygonBoundary : AreaBoundary + { + Position _origin; + List _vertices; + + public PolygonBoundary(Position origin, List vertices, bool isInverted = false) : base(isInverted) + { + _origin = origin; + _vertices = vertices; + } + + public override bool IsWithinBoundaryArea(Position pos) + { + return pos.IsInPolygon2D(_origin, _vertices); + } + } + class BoundaryUnionBoundary : AreaBoundary { public BoundaryUnionBoundary(AreaBoundary b1, AreaBoundary b2, bool isInverted = false) : base(isInverted) diff --git a/Source/Game/Maps/GridNotifiers.cs b/Source/Game/Maps/GridNotifiers.cs index 9134bf30e..5c11f3c92 100644 --- a/Source/Game/Maps/GridNotifiers.cs +++ b/Source/Game/Maps/GridNotifiers.cs @@ -384,7 +384,7 @@ namespace Game.Maps CreatureUnitRelocationWorker(i_creature, player); } } - + public class PacketSenderRef : IDoWork { ServerPacket Data;