From 14b1a1203fcaf1d97fa84240f3810e1da70e9e9a Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Thu, 28 Mar 2024 07:25:44 +0100 Subject: [PATCH] fix: cyclist.now() should return 0 when stopped --- packages/core/cyclist.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/cyclist.mjs b/packages/core/cyclist.mjs index b0727ee5..2251dcf6 100644 --- a/packages/core/cyclist.mjs +++ b/packages/core/cyclist.mjs @@ -67,6 +67,9 @@ export class Cyclist { ); } now() { + if (!this.started) { + return 0; + } const secondsSinceLastTick = this.getTime() - this.lastTick - this.clock.duration; return this.lastBegin + secondsSinceLastTick * this.cps; // + this.clock.minLatency; }