Skip to content

Commit

Permalink
#52 Raw: fix sorting grenades
Browse files Browse the repository at this point in the history
  • Loading branch information
drweissbrot committed Jun 9, 2023
1 parent c88c892 commit a41861d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/themes/raw/gsi/parse-players.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ export const parsePlayers = () => Object.entries(gsiState.allplayers).map(([stea

return [parsed]
}).sort((a, b) => {
if (a.isGrenade && b.isGrenade) return grenadeOrderIndices[b.name] - grenadeOrderIndices[a.name]
if (a.isGrenade !== b.isGrenade) return a.isGrenade - b.isGrenade
if (a.isGrenade && b.isGrenade) {
return grenadeOrderIndices[a.name] - grenadeOrderIndices[b.name]
}

if (a.isGrenade) return 1
if (b.isGrenade) return -1

if (a.name > b.name) return 1
if (a.name < b.name) return -1
Expand Down

0 comments on commit a41861d

Please sign in to comment.