PlayerPool GetClosest and GetClosestOnSide incorrect behaviour
DodoBirby opened this issue · 1 comments
DodoBirby commented
The GetClosest function uses an incorrect algorithm to calculate the closest player.
Situation:
2 players at equivalent y coordinates, but 1 player is closer on the x coordinate.
Expected result:
Player who is closer on x coordinate gets chosen.
Actual Result:
Arbitrary based on which player is first in the pool.
GetClosestOnSide seems to not take into account y coordinates for left and right sides, and doesn't take into account x coordinates for up and down sides but depending on their intended use case this might not be a bug.
Lojemiru commented
Definitely unintended behavior. Reviewing the methods, the code I wrote for these is exceptionally dumb... should be fixed now, pushing shortly. Thanks for the report!