From a58e1b6b8950034bff4741bbadc1976a41696228 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 5 Sep 2024 01:41:45 -0500 Subject: [PATCH] fix: only on tick --- app/client/interpolator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/client/interpolator.js b/app/client/interpolator.js index 5339c7a..7a248e3 100644 --- a/app/client/interpolator.js +++ b/app/client/interpolator.js @@ -7,6 +7,7 @@ export default class Interpolator { accept(state) { const packet = state; if ('Tick' !== packet.type) { + postMessage(packet); return; } this.penultimate = this.latest; @@ -93,7 +94,7 @@ const interpolate = (now) => { onmessage = async (event) => { interpolator.accept(event.data); - if (interpolator.penultimate) { + if (interpolator.penultimate && 'Tick' === event.data.type) { postMessage({ type: 'Tick', payload: {