Core/PacketIO: Updated packet structures to 9.2.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/9f30afe3528441571f89cb2e1775c756774fa0cd)
This commit is contained in:
@@ -370,6 +370,9 @@ namespace Game.Entities
|
||||
case AreaTriggerTypes.Cylinder:
|
||||
SearchUnitInCylinder(targetList);
|
||||
break;
|
||||
case AreaTriggerTypes.Disk:
|
||||
SearchUnitInDisk(targetList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -452,6 +455,18 @@ namespace Game.Entities
|
||||
targetList.RemoveAll(unit => unit.GetPositionZ() < minZ || unit.GetPositionZ() > maxZ);
|
||||
}
|
||||
|
||||
void SearchUnitInDisk(List<Unit> targetList)
|
||||
{
|
||||
SearchUnits(targetList, GetMaxSearchRadius(), false);
|
||||
|
||||
float innerRadius = _shape.DiskDatas.InnerRadius;
|
||||
float height = _shape.DiskDatas.Height;
|
||||
float minZ = GetPositionZ() - height;
|
||||
float maxZ = GetPositionZ() + height;
|
||||
|
||||
targetList.RemoveAll(unit => unit.IsInDist2d(this, innerRadius) || unit.GetPositionZ() < minZ || unit.GetPositionZ() > maxZ);
|
||||
}
|
||||
|
||||
void HandleUnitEnterExit(List<Unit> newTargetList)
|
||||
{
|
||||
List<ObjectGuid> exitUnits = _insideUnits;
|
||||
|
||||
@@ -44,6 +44,9 @@ namespace Game.Entities
|
||||
[FieldOffset(0)]
|
||||
public cylinderdatas CylinderDatas;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public diskDatas DiskDatas;
|
||||
|
||||
public struct defaultdatas
|
||||
{
|
||||
public fixed float Data[SharedConst.MaxAreatriggerEntityData];
|
||||
@@ -80,6 +83,18 @@ namespace Game.Entities
|
||||
public float LocationZOffset;
|
||||
public float LocationZOffsetTarget;
|
||||
}
|
||||
// AREATRIGGER_TYPE_DISK
|
||||
public struct diskDatas
|
||||
{
|
||||
public float InnerRadius;
|
||||
public float InnerRadiusTarget;
|
||||
public float OuterRadius;
|
||||
public float OuterRadiusTarget;
|
||||
public float Height;
|
||||
public float HeightTarget;
|
||||
public float LocationZOffset;
|
||||
public float LocationZOffsetTarget;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -183,7 +198,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public class AreaTriggerShapeInfo : AreaTriggerData
|
||||
{
|
||||
{
|
||||
public AreaTriggerTypes TriggerType;
|
||||
|
||||
public AreaTriggerShapeInfo()
|
||||
@@ -200,7 +215,9 @@ namespace Game.Entities
|
||||
case AreaTriggerTypes.Box:
|
||||
return MathF.Sqrt(BoxDatas.Extents[0] * BoxDatas.Extents[0] / 4 + BoxDatas.Extents[1] * BoxDatas.Extents[1] / 4);
|
||||
case AreaTriggerTypes.Cylinder:
|
||||
return CylinderDatas.Radius;
|
||||
return Math.Max(CylinderDatas.Radius, CylinderDatas.RadiusTarget);
|
||||
case AreaTriggerTypes.Disk:
|
||||
return Math.Max(DiskDatas.OuterRadius, DiskDatas.OuterRadiusTarget);
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
@@ -210,6 +227,7 @@ namespace Game.Entities
|
||||
public bool IsBox() { return TriggerType == AreaTriggerTypes.Box; }
|
||||
public bool IsPolygon() { return TriggerType == AreaTriggerTypes.Polygon; }
|
||||
public bool IsCylinder() { return TriggerType == AreaTriggerTypes.Cylinder; }
|
||||
public bool IsDisk() { return TriggerType == AreaTriggerTypes.Disk; }
|
||||
}
|
||||
|
||||
public class AreaTriggerOrbitInfo
|
||||
|
||||
Reference in New Issue
Block a user