Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code analyzer fix #517

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D033Eros.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
var source = Sources(slot, actor).FirstOrDefault();
if (source != default)
{
var component = _aoe.ActiveAOEs(slot, actor);
var forbidden = new List<Func<WPos, float>>(component.Count());
foreach (var c in component)
forbidden.Add(ShapeDistance.Rect(c.Origin, Module.PrimaryActor.Rotation, 40, 0, 6));
Components.GenericAOEs.AOEInstance[] component = [.. _aoe.ActiveAOEs(slot, actor)];
var len = component.Length;
var forbidden = new List<Func<WPos, float>>(len);
for (var i = 0; i < len; ++i)
forbidden.Add(ShapeDistance.Rect(component[i].Origin, Module.PrimaryActor.Rotation, 40, 0, 6));
if (forbidden.Count != 0)
hints.AddForbiddenZone(p => forbidden.Min(f => f(p)), source.Activation);
}
Expand All @@ -102,10 +103,11 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
var source = Sources(slot, actor).FirstOrDefault();
if (source != default)
{
var component = _aoe.ActiveAOEs(slot, actor);
var forbidden = new List<Func<WPos, float>>(component.Count());
foreach (var c in component)
forbidden.Add(ShapeDistance.Rect(c.Origin, new Angle(), 40, 40, 6));
Components.GenericAOEs.AOEInstance[] component = [.. _aoe.ActiveAOEs(slot, actor)];
var len = component.Length;
var forbidden = new List<Func<WPos, float>>(len);
for (var i = 0; i < len; ++i)
forbidden.Add(ShapeDistance.Rect(component[i].Origin, new Angle(), 40, 40, 6));
if (forbidden.Count != 0)
hints.AddForbiddenZone(p => forbidden.Min(f => f(p)), source.Activation);
}
Expand Down