diff --git a/BossMod/BossModule/ArenaBounds.cs b/BossMod/BossModule/ArenaBounds.cs index 653a39020f..d8392443ca 100644 --- a/BossMod/BossModule/ArenaBounds.cs +++ b/BossMod/BossModule/ArenaBounds.cs @@ -127,6 +127,7 @@ private Pathfinding.Map BuildMap() // if rotation is 0, half-width is along X and half-height is along Z public record class ArenaBoundsRect(float HalfWidth, float HalfHeight, Angle Rotation = default, float MapResolution = 0.5f) : ArenaBounds(CalculateRadius(HalfHeight, HalfWidth, Rotation), MapResolution) { + private Pathfinding.Map? _cachedMap; public readonly WDir Orientation = Rotation.ToDirection(); private static float CalculateRadius(float HalfWidth, float HalfHeight, Angle Rotation) @@ -147,10 +148,17 @@ private static float CalculateRadius(float HalfWidth, float HalfHeight, Angle Ro } protected override PolygonClipper.Operand BuildClipPoly() => new(CurveApprox.Rect(Orientation, HalfWidth, HalfHeight)); - public override void PathfindMap(Pathfinding.Map map, WPos center) => map.Init(MapResolution, center, HalfWidth, HalfHeight, Rotation); + public override void PathfindMap(Pathfinding.Map map, WPos center) => map.Init(_cachedMap ??= BuildMap(), center); public override bool Contains(WDir offset) => offset.InRect(Orientation, HalfHeight, HalfHeight, HalfWidth); public override float IntersectRay(WDir originOffset, WDir dir) => Intersect.RayRect(originOffset, dir, Orientation, HalfWidth, HalfHeight); + private Pathfinding.Map BuildMap() + { + var map = new Pathfinding.Map(MapResolution, default, HalfWidth, HalfHeight, Rotation); + map.BlockPixelsInside(ShapeDistance.InvertedRect(default, Rotation, HalfHeight, HalfHeight, HalfWidth), 0, 0); + return map; + } + public override WDir ClampToBounds(WDir offset) { var dx = MathF.Abs(offset.Dot(Orientation.OrthoL())); diff --git a/BossMod/Modules/Endwalker/Dungeon/D13LunarSubterrane/D132DamcyanAntlion.cs b/BossMod/Modules/Endwalker/Dungeon/D13LunarSubterrane/D132DamcyanAntlion.cs index 7f4902089e..562fde2c32 100644 --- a/BossMod/Modules/Endwalker/Dungeon/D13LunarSubterrane/D132DamcyanAntlion.cs +++ b/BossMod/Modules/Endwalker/Dungeon/D13LunarSubterrane/D132DamcyanAntlion.cs @@ -29,7 +29,7 @@ class Sandblast(BossModule module) : Components.RaidwideCast(module, ActionID.Ma class SandblastVoidzone(BossModule module) : Components.GenericAOEs(module) { - private static readonly AOEShapeRect rect = new(19.5f, 5, 19.5f); + private static readonly AOEShapeRect rect = new(19.5f, 2.5f, 19.5f); private readonly List _aoes = []; public override IEnumerable ActiveAOEs(int slot, Actor actor) => _aoes;