Skip to content

Commit

Permalink
change .some to for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Apr 4, 2024
1 parent 6b46c43 commit 4365d94
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ class LivingFlamePrePullNormalizer extends EventsNormalizer {
normalize(events: AnyEvent[]) {
const fixedEvents: AnyEvent[] = events;

fixedEvents.some((event, eventIdx) => {
for (let eventIdx = 0; eventIdx < fixedEvents.length; eventIdx += 1) {
const event = fixedEvents[eventIdx];
// The first seen cast is not the proper type
if (
(event.type === EventType.BeginCast ||
event.type === EventType.EmpowerStart ||
event.type === EventType.EmpowerEnd) &&
event.sourceID === this.owner.selectedCombatant.id
) {
return true;
break;
}

// Check the first seen cast
Expand All @@ -40,7 +41,7 @@ class LivingFlamePrePullNormalizer extends EventsNormalizer {
) {
// First cast found is not living flame or was instant
if (event.ability.guid !== SPELLS.LIVING_FLAME_CAST.id || isFromBurnout(event)) {
return true;
break;
}

// Fabricate the pre-pull event
Expand Down Expand Up @@ -74,11 +75,9 @@ class LivingFlamePrePullNormalizer extends EventsNormalizer {
};

fixedEvents.splice(eventIdx, 0, beginCastEvent);
return true;
break;
}

return false;
});
}

return fixedEvents;
}
Expand Down

0 comments on commit 4365d94

Please sign in to comment.