Core/AreaTriggers: Fix triggering of client areatriggers for some shapes

Port From (https://github.com/TrinityCore/TrinityCore/commit/b070e63fa867f7f25e73e9ef3aafbe18902a50e9)
This commit is contained in:
Hondacrx
2024-08-25 19:11:12 -04:00
parent a21c82d0c0
commit c2409af60b
11 changed files with 218 additions and 111 deletions
+17
View File
@@ -751,6 +751,23 @@ namespace Game
return pointsOfInterestStorage.LookupByKey(id);
}
public List<Position> GetVerticesForAreaTrigger(AreaTriggerRecord areaTrigger)
{
List<Position> vertices = new();
if (areaTrigger != null && areaTrigger.ShapeType == 3 /* Polygon */)
{
var pathNodes = Global.DB2Mgr.GetNodesForPath((uint)areaTrigger.ShapeID);
if (pathNodes != null)
vertices.AddRange(pathNodes.Select(dbcPosition => new Position(dbcPosition.X, dbcPosition.Y, dbcPosition.Z)));
// Drop first node (areatrigger position)
vertices.RemoveAt(0);
}
return vertices;
}
public void LoadGraveyardZones()
{
uint oldMSTime = Time.GetMSTime();