From 8f4f45798471d5b0069d7ac2caaf7d6a389ce981 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 25 Oct 2020 02:34:32 +0200
Subject: [PATCH] Only draw new game content on tick completion.

---
 new2/plomrogue/game.py | 1 +
 new2/rogue_chat.html   | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/new2/plomrogue/game.py b/new2/plomrogue/game.py
index e0c0715..c8c2f3c 100755
--- a/new2/plomrogue/game.py
+++ b/new2/plomrogue/game.py
@@ -55,6 +55,7 @@ class Game(GameBase):
         self.io.send('TURN ' + str(self.turn))
         for t in self.things:
             send_thing(t)
+        self.io.send('GAME_STATE_COMPLETE')
 
     def run_tick(self):
         to_delete = []
diff --git a/new2/rogue_chat.html b/new2/rogue_chat.html
index dde77be..cefc451 100644
--- a/new2/rogue_chat.html
+++ b/new2/rogue_chat.html
@@ -176,10 +176,11 @@ websocket.onmessage = function (event) {
   if (tokens[0] === 'TURN') {
     game.things = {}
     game.tick = parseInt(tokens[1]);
-    tui.draw_tick_line();
-    tui.draw_map();
   } else if (tokens[0] === 'THING_POS') {
     game.things[tokens[1]] = parser.parse_position(tokens[2]); 
+  } else if (tokens[0] === 'GAME_STATE_COMPLETE') {
+    tui.draw_tick_line();
+    tui.draw_map();
     tui.draw_map();
   } else if (tokens[0] === 'LOG') {
      tui.log_msg(' ' + tokens[1]);
-- 
2.30.2