fix: cyclist.now() should return 0 when stopped

This commit is contained in:
Felix Roos 2024-03-28 07:25:44 +01:00
parent 060d2cfe2b
commit 14b1a1203f

View File

@ -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;
}