fix: only on tick

This commit is contained in:
cha0s 2024-09-05 01:41:45 -05:00
parent 48a45533f5
commit a58e1b6b89

View File

@ -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: {