From 34ecca0b4633e90de873c63fa043246515158632 Mon Sep 17 00:00:00 2001 From: Klemek Date: Tue, 8 Jan 2019 10:18:49 +0100 Subject: [PATCH] Fixed tail of winner disappearing --- client/main.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/client/main.js b/client/main.js index 71220d8..3682896 100644 --- a/client/main.js +++ b/client/main.js @@ -30,8 +30,8 @@ setInterval(function () { //main loop Object.keys(players).forEach(function (name) { const p = players[name]; - if (p.alive) { - if (p.starting <= 0 && !lock) { + if (p.alive && p.starting <= 0) { + if (!lock) { if (!history[p.name]) history[p.name] = { i0: 0, @@ -40,12 +40,6 @@ setInterval(function () { else history[p.name].i0 = (history[p.name].i0 + 1) % hsize; history[p.name].list[history[p.name].i0] = clone(p.pos); - } else { - history[p.name] = { - i0: 0, - list: new Array(hsize) - }; - history[p.name].list[0] = clone(p.pos); } } });