mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 05:28:41 +00:00
fix: cyclist.now() should return 0 when stopped
This commit is contained in:
parent
060d2cfe2b
commit
14b1a1203f
@ -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…
x
Reference in New Issue
Block a user