]> git.cworth.org Git - empires-server/blobdiff - empires.js
empires: Return immediately from reveal_next if we aren't in the REVEAL state
[empires-server] / empires.js
index b0fc79ea2fb664c52246549f6c720a81b2f93391..2794c47ee41006098f3547ec685049eef7f0d520 100644 (file)
@@ -79,6 +79,12 @@ class Game {
   }
 
   reveal_next() {
+    /* Don't try to reveal anything if we aren't in the reveal state. */
+    if (this.state != GameState.REVEAL) {
+      clearInterval(this.reveal_interval);
+      return;
+    }
+
     if (this.reveal_index >= this.characters_to_reveal.length) {
       clearInterval(this.reveal_interval);
       this.broadcast_event("character-reveal", '{"character":""}');