Core/AreaTriggers: Implemented new areatrigger type: bounded plane
Port From (https://github.com/TrinityCore/TrinityCore/commit/6856b248836205f3567d27848541859b93d93469)
This commit is contained in:
@@ -376,6 +376,9 @@ namespace Game.Entities
|
||||
case AreaTriggerTypes.Disk:
|
||||
SearchUnitInDisk(targetList);
|
||||
break;
|
||||
case AreaTriggerTypes.BoundedPlane:
|
||||
SearchUnitInBoundedPlane(targetList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -470,6 +473,25 @@ namespace Game.Entities
|
||||
targetList.RemoveAll(unit => unit.IsInDist2d(this, innerRadius) || unit.GetPositionZ() < minZ || unit.GetPositionZ() > maxZ);
|
||||
}
|
||||
|
||||
void SearchUnitInBoundedPlane(List<Unit> targetList)
|
||||
{
|
||||
SearchUnits(targetList, GetMaxSearchRadius(), false);
|
||||
|
||||
Position boxCenter = GetPosition();
|
||||
float extentsX, extentsY;
|
||||
|
||||
unsafe
|
||||
{
|
||||
extentsX = _shape.BoxDatas.Extents[0];
|
||||
extentsY = _shape.BoxDatas.Extents[1];
|
||||
}
|
||||
|
||||
targetList.RemoveAll(unit =>
|
||||
{
|
||||
return !unit.IsWithinBox(boxCenter, extentsX, extentsY, MapConst.MapSize);
|
||||
});
|
||||
}
|
||||
|
||||
void HandleUnitEnterExit(List<Unit> newTargetList)
|
||||
{
|
||||
List<ObjectGuid> exitUnits = _insideUnits;
|
||||
|
||||
Reference in New Issue
Block a user