From a769d4675ee33d59d70e059870cc89c5ac731d07 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 27 Jun 2020 08:29:49 -0700 Subject: [PATCH] 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. --- empathy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.43.0