fix: cyclist.now() should return 0 when stopped
This commit is contained in:
parent
060d2cfe2b
commit
14b1a1203f
1 changed files with 3 additions and 0 deletions
|
|
@ -67,6 +67,9 @@ export class Cyclist {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
now() {
|
now() {
|
||||||
|
if (!this.started) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
const secondsSinceLastTick = this.getTime() - this.lastTick - this.clock.duration;
|
const secondsSinceLastTick = this.getTime() - this.lastTick - this.clock.duration;
|
||||||
return this.lastBegin + secondsSinceLastTick * this.cps; // + this.clock.minLatency;
|
return this.lastBegin + secondsSinceLastTick * this.cps; // + this.clock.minLatency;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue