Skip to content

Commit

Permalink
Fall back to localeCompare to avoid mis-ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon committed Sep 17, 2024
1 parent 0326aca commit 8f68737
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions GuildWarsPartySearch.NodeJSServer/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ function reassign_bot_clients(request) {
let bots_to_reassign = Object.values(bot_clients).filter((bot_client) => {
return bot_client.explored_maps_weighting;
}).sort((a, b) => {
if(a.explored_maps_weighting === b.explored_maps_weighting)
return (a.client_id || '').localeCompare(b.client_id || '');
return (a.explored_maps_weighting || 0) - (b.explored_maps_weighting || 0)
});
let bots_assigned = [];
Expand Down

0 comments on commit 8f68737

Please sign in to comment.