Skip to content

Conversation

@jacob-keller
Copy link

When tracking the bat positions it is possible for the different lines
to arrive in an arbitrary order. This results in the callout being
inconsistent even when the bats are in the same position. For example it
might call out "away from bats S/N" instead of always consistently
saying "away from bats N/S".

Use sort() to make sure the bat callouts are consistent and always
display the directions in the same order.

When tracking the bat positions it is possible for the different lines
to arrive in an arbitrary order. This results in the callout being
inconsistent even when the bats are in the same position. For example it
might call out "away from bats S/N" instead of always consistently
saying "away from bats N/S".

Use sort() to make sure the bat callouts are consistent and always
display the directions in the same order.
@github-actions github-actions bot added raidboss /ui/raidboss module needs-review Awaiting review labels Feb 2, 2026
@jacob-keller
Copy link
Author

It bothered me that the callouts for blast beat would sometimes have the order different. It helps with readability if the order is consistent, and I think the sort for the DirectionOutput16 type will prioritize ordering them based in the north to south output. This will make it easier to parse the output and ensure that the bat position for your relative spot is easier to find quickly. (Rather than having to search for it in a set of 2 or 3 outcomes that might be in arbitrary order).

@xiashtra
Copy link
Collaborator

xiashtra commented Feb 2, 2026

I believe this will give unexpected output with the default sort function. For example, if the results were N, NNE, and ENE, the default sort function will return ENE, N, NNE, since the default sort is lexicographical order. I expect what you want is for the positions to return in N -> clockwise order, which would require a custom sort function.

@valarnin
Copy link
Collaborator

valarnin commented Feb 2, 2026

Something like this should give a consistent sort order, but might need to swap l/r:

        const [dir1, dir2] = data.bats.inner.sort((l, r) => Directions.output16Dir.indexOf(l) - Directions.output16Dir.indexOf(r));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Awaiting review raidboss /ui/raidboss module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants