Permalink
Browse files

Fix bug with setting home level in a match.

  • Loading branch information...
roncli committed Mar 7, 2017
1 parent cf372e4 commit c0a6f5458fb083b0a6e78e04d0a4f221c8a74d6e
Showing with 3 additions and 3 deletions.
  1. +3 −3 fusion.js
@@ -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);

0 comments on commit c0a6f54

Please sign in to comment.