X-Git-Url: https://git.cworth.org/git?p=empires-server;a=blobdiff_plain;f=empathy.js;h=ba25cc4c49d7e996ba2c93505efc0ab2ba75b9d8;hp=7b27ee40c5d196866b19036455c66e6b5ebe713e;hb=23ab0d1f2fe34ae413a3a37dc6c01855148f16b9;hpb=d77b8410640b3b6279999a064945c5c8c1d54a05 diff --git a/empathy.js b/empathy.js index 7b27ee4..ba25cc4 100644 --- a/empathy.js +++ b/empathy.js @@ -663,7 +663,8 @@ router.post('/judged/:prompt_id([0-9]+)', (request, response) => { /* If every player who answered has also judged, then there's no * need to wait for anything else. */ - if (game.state.players_judged.length >= game.state.players_answered.length) + const judged_set = new Set(game.state.players_judged); + if ([...game.state.players_answered].filter(x => !judged_set.has(x)).length === 0) game.compute_scores(); });