From ca68537c61b64f40f0fa6a43f1fadb2671bfaf85 Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 7 Apr 2020 18:04:49 +0200 Subject: same in tick --- webAO/client.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webAO/client.js b/webAO/client.js index 1a4d8db..3bcde46 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1695,6 +1695,10 @@ async changeBackground(position) { * XXX: This relies on a global variable `this.chatmsg`! */ tick() { + if (this._animating) { + this.updater = setTimeout(() => this.tick(), UPDATE_INTERVAL); + } + const nameBox = document.getElementById("client_name"); const chatBox = document.getElementById("client_chat"); const chatContainerBox = document.getElementById("client_chatcontainer"); @@ -1703,11 +1707,7 @@ async changeBackground(position) { const pairSprite = document.getElementById("client_pair_char"); const eviBox = document.getElementById("client_evi"); const shoutSprite = document.getElementById("client_shout"); - const chatBoxInner = document.getElementById("client_inner_chat"); - - if (this._animating) { - this.updater = setTimeout(() => this.tick(), UPDATE_INTERVAL); - } + const chatBoxInner = document.getElementById("client_inner_chat"); // TODO: preanims sometimes play when they're not supposed to if (this.textTimer >= this.shoutTimer && this.chatmsg.startpreanim) { -- cgit