fix: round cycleTicks to prevent float precision drift

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-08 03:08:05 +00:00
parent f5857f72d8
commit a778bee58d
+1 -1
View File
@@ -91,7 +91,7 @@ export class GameLoop {
getGameTime(): number {
const dayTicks = 100 / ENERGY_DECAY_PER_TICK;
const nightTicks = dayTicks / DAY_NIGHT_RATIO;
const cycleTicks = dayTicks + nightTicks;
const cycleTicks = Math.round(dayTicks + nightTicks);
return (this.tick % cycleTicks) / cycleTicks;
}
}