Skip to content

Commit

Permalink
Fix bug with setting home level in a match.
Browse files Browse the repository at this point in the history
  • Loading branch information
roncli committed Mar 7, 2017
1 parent cf372e4 commit c0a6f54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fusion.js
Expand Up @@ -1062,11 +1062,11 @@ Fusion.discordMessages = {
awayPlayer;

// Select home level.
match.sort((a, b) => {
match.sort((a, b) => (
(event.matches.filter((m) => !m.cancelled && m.home === a).length - event.matches.filter((m) => !m.cancelled && m.home === b).length) ||
(event.matches.filter((m) => !m.cancelled && m.players.indexOf(b) !== -1 && m.home !== b).length - event.matches.filter((m) => !m.cancelled && m.players.indexOf(a) !== -1 && m.home !== a).length) ||
(Math.random() < 0.5 ? 1 : -1);
});
(Math.random() < 0.5 ? 1 : -1)
));
awayPlayer = obsDiscord.members.get(match[1]),
eventMatch.home = match[0];
event.matches.push(eventMatch);
Expand Down

0 comments on commit c0a6f54

Please sign in to comment.