Refactored how zones work. Cleaned out a lot of duplciations and smoothed out how Zones/PrivateAreas work.

This commit is contained in:
Filip Maj 2022-02-05 14:05:32 -05:00
parent 56ba641e2a
commit 563118372a
32 changed files with 247 additions and 417 deletions

View file

@ -55,17 +55,17 @@ namespace Meteor.Map.actors.chara.ai
{
PreparePath(dest.X, dest.Y, dest.Z, stepSize, maxPath, polyRadius);
}
//TODO: Verify pathfind with new area setup
public void PreparePath(float x, float y, float z, float stepSize = 1.25f, int maxPath = 40, float polyRadius = 0.0f)
{
var pos = new Vector3(owner.positionX, owner.positionY, owner.positionZ);
var dest = new Vector3(x, y, z);
Zone zone;
if (owner.GetZone() is PrivateArea || owner.GetZone() is PrivateAreaContent)
zone = (Zone)((PrivateArea)owner.GetZone()).GetParentZone();
if (owner.CurrentArea is PrivateArea || owner.CurrentArea is PrivateAreaContent)
zone = (Zone)((PrivateArea)owner.CurrentArea).GetParentZone();
else
zone = (Zone)owner.GetZone();
zone = (Zone)owner.CurrentArea;
var sw = new System.Diagnostics.Stopwatch();
sw.Start();