X-Git-Url: https://git.cworth.org/git?p=empires-server;a=blobdiff_plain;f=empathy.js;h=1cd120ee5e098870112f91c13025464fea079a40;hp=b7d01a0566c2d5b379db9ab90c3c77f4c8928bbd;hb=1aee14be31c8cac3bd8fc089a07e9c526666edd8;hpb=7cfa4c75739452a6022e2266cc4d6444ef79f4a5 diff --git a/empathy.js b/empathy.js index b7d01a0..1cd120e 100644 --- a/empathy.js +++ b/empathy.js @@ -506,7 +506,12 @@ router.post('/end-answers/:prompt_id([0-9]+)', (request, response) => { else response.sendStatus(404); - if (game.state.end_answers.size > (game.state.players_answered.length / 2)) + /* The majority rule here includes all players that have answered as + * well as all that have started typing. */ + const players_involved = (game.state.players_answered.length + + game.state.players_answering.size); + + if (game.state.end_answers.size > players_involved / 2) game.perform_judging(); });