Core/AI: AreaBoundary refactor

Port From (https://github.com/TrinityCore/TrinityCore/commit/3f79c9f69674618a7d7e2bf8484f9ec6ce15b2df)
This commit is contained in:
hondacrx
2020-05-06 15:15:21 -04:00
parent db1873492d
commit ffe569ffb7
3 changed files with 50 additions and 68 deletions
+12
View File
@@ -384,6 +384,18 @@ namespace Game.AI
return me.SummonCreature(entry, pos, summonType, despawnTime);
}
public static bool IsInBounds(List<AreaBoundary> boundary, Position pos)
{
if (boundary == null)
return true;
foreach (AreaBoundary areaBoundary in boundary)
if (!areaBoundary.IsWithinBoundary(pos))
return false;
return true;
}
public void SetBoundary(List<AreaBoundary> boundary)
{
_boundary = boundary;