still duplicated ticks?

This commit is contained in:
Thilo Behnke
2022-07-10 18:31:23 +02:00
parent 81156f3f6f
commit ff69bd2977

View File

@@ -7,10 +7,18 @@
let frame: number;
let lastTick;
$: if (networkTickEvents && $networkTickEvents.hasNext) {
const tick = networkTickEvents.next() as HostSessionSnapshot;
if (tick != null) {
gameField.update(tick.objects, tick.state);
if (lastTick && lastTick.ts >= tick.ts) {
// TODO: How is this possible?
console.warn(`!!!! Duplicated Tick ${tick.ts} (vs ${lastTick.ts}) !!!!`)
} else {
gameField.update(tick.objects, tick.state);
lastTick = tick;
}
}
}