From: Carl Worth Date: Sat, 27 Jun 2020 15:29:49 +0000 (-0700) Subject: Omit inactive players when reporting scores X-Git-Url: https://git.cworth.org/git?p=empires-server;a=commitdiff_plain;h=a769d4675ee33d59d70e059870cc89c5ac731d07 Omit inactive players when reporting scores If they have left the game, then we don't need to report a score for them in this round, since they obviously didn't play in it. With this commit, the new test added in the previous commit now passes, and the entire test suite is back to passing again. --- diff --git a/empathy.js b/empathy.js index 0ae52df..bc846c1 100644 --- a/empathy.js +++ b/empathy.js @@ -481,7 +481,7 @@ class Empathy extends Game { group.players.forEach(p => p.round_score += group.players.size); } - const scores = this.players.map(p => { + const scores = this.players.filter(p => p.active).map(p => { return { player: p.name, score: p.round_score