Skip to content

Commit c142845

Browse files
committed
2 parents 3428291 + 1450b90 commit c142845

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

BossMod/Autorotation/DNC/DNCActions.cs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -213,32 +213,9 @@ private void UpdatePlayerState()
213213
_state.PelotonLeft = 0;
214214
}
215215

216-
private Targeting SelectBestTarget(
217-
AIHints.Enemy initial,
218-
float maxDistanceFromPlayer,
219-
Func<Actor, int> prio
220-
)
216+
private Targeting SelectBestTarget(AIHints.Enemy initial, float maxDistanceFromPlayer, Func<Actor, int> prio)
221217
{
222-
var newBest = initial;
223-
int currentPrio = prio(initial.Actor);
224-
foreach (
225-
var enemy in Autorot
226-
.Hints
227-
.PriorityTargets
228-
.Where(
229-
x =>
230-
x != initial
231-
&& x.Actor.Position.InCircle(Player.Position, maxDistanceFromPlayer)
232-
)
233-
)
234-
{
235-
int potential = prio(enemy.Actor);
236-
if (potential > currentPrio)
237-
{
238-
newBest = enemy;
239-
currentPrio = potential;
240-
}
241-
}
218+
var newBest = FindBetterTargetBy(initial, maxDistanceFromPlayer, x => prio(x.Actor)).Target;
242219
return new(newBest, newBest.StayAtLongRange ? 25 : 15);
243220
}
244221

0 commit comments

Comments
 (0)