]> git.cworth.org Git - empires-server/commitdiff
Fix the /reset endpoint
authorCarl Worth <cworth@cworth.org>
Wed, 10 Jun 2020 14:25:13 +0000 (07:25 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 10 Jun 2020 14:25:13 +0000 (07:25 -0700)
The fix here was pretty simple. I'd only missed this because I had
forgotten to add an explicit setting of state.scores to null in the
constructor, (so then forgot to also do the same in reset()).

empathy.js

index 3ec4a7b74d3dda75f237e1a0a944b7edcc5010dd..11539d854a4473c38be1b7a8373f903986bef7f5 100644 (file)
@@ -7,7 +7,8 @@ class Empathy extends Game {
     this.state = {
       prompts: [],
       active_prompt: null,
-      players_answered: 0
+      players_answered: 0,
+      scores: null
     };
     this.answers = [];
     this.next_prompt_id = 1;
@@ -16,6 +17,8 @@ class Empathy extends Game {
   reset() {
     this.state.active_prompt = null;
     this.state.players_answered = 0;
+    this.state.scores = null;
+
     this.answers = [];
 
     this.broadcast_event_object('game-state', this.state);