X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=empathy%2Fempathy.jsx;h=001dcd5eeeb5ac3f943d368f971f8a78d19981d3;hb=49a7e9338a8160363ede955ae0d036abc360a359;hp=6e98b327be7ceea20096c3a4e5eb56f3d95c3f0d;hpb=5fb4dec0d3dc03696ec2d00788d2d657a23b8bd1;p=lmno.games
diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx
index 6e98b32..001dcd5 100644
--- a/empathy/empathy.jsx
+++ b/empathy/empathy.jsx
@@ -433,14 +433,14 @@ const PromptOptions = React.memo(props => {
const LetsPlay = React.memo(props => {
- const quorum = Math.round((props.num_players + 1) / 2);
+ const quorum = Math.max(0, props.num_players - props.prompts.length);
const max_votes = props.prompts.reduce(
(max_so_far, v) => Math.max(max_so_far, v.votes.length), 0);
if (max_votes < quorum)
return null;
- const candidates = props.prompts.filter(p => p.votes.length >= quorum);
+ const candidates = props.prompts.filter(p => p.votes.length >= max_votes);
const index = Math.floor(Math.random() * candidates.length);
const winner = candidates[index];
@@ -1310,15 +1310,15 @@ class Game extends React.PureComponent {
,
- ,
,
+
];
}