]> git.cworth.org Git - empires-server/blobdiff - empathy.js
Fix some typos in some code comments
[empires-server] / empathy.js
index 3728a0e5dc318904c488f264773e41abe8263213..428627ce863d6913311aee67bd9caccdc0ee20c0 100644 (file)
@@ -49,7 +49,7 @@ class Empathy extends Game {
 
   reset() {
 
-    /* Before closing out the current round, we accumulate that score
+    /* Before closing out the current round, we accumulate the score
      * for each player into their runnning total. */
     for (let score of this.state.scores.scores) {
       const player = this.players.find(p => p.name === score.player);
@@ -261,6 +261,10 @@ class Empathy extends Game {
       return a.toLowerCase().localeCompare(b.toLowerCase());
     });
 
+    if (this.judging_start_time_ms === 0) {
+      this.judging_start_time_ms = Date.now();
+    }
+
     this.broadcast_event_object('ambiguities', this.state.ambiguities);
   }
 
@@ -315,7 +319,7 @@ class Empathy extends Game {
     this.state.players_judging.delete(player.name);
     this.state.players_judged.push(player.name);
 
-    /* And notify all players this this player has judged. */
+    /* And notify all players that this player has judged. */
     this.broadcast_event_object('player-judged', player.name);
 
     /* If no players are left in the judging list then we don't need
@@ -336,6 +340,7 @@ class Empathy extends Game {
   }
 
   receive_judging(prompt_id, session_id) {
+
     const player = this.players_by_session[session_id];
     if (! player)
       return { valid: false, message: "Player not found" };
@@ -358,10 +363,7 @@ class Empathy extends Game {
       }, PHASE_IDLE_TIMEOUT * 1000);
     }
 
-    if (this.judging_start_time_ms === 0)
-      this.judging_start_time_ms = Date.now();
-
-    /* Notify all players this this player is actively judging. */
+    /* Notify all players that this player is actively judging. */
     this.state.players_judging.add(player.name);
     this.broadcast_event_object('player-judging', player.name);