Update clock synchronization logic in RuntimeHost

This commit is contained in:
2026-04-27 17:59:49 +02:00
parent 9182bf8b62
commit 4940456cb8

View File

@@ -5052,14 +5052,16 @@ export class RuntimeHost {
uniform.value = this.volumeTime;
}
if (this.currentClockState !== null && simulationDt > 0) {
if (
this.sceneReady &&
this.currentClockState !== null &&
simulationDt > 0
) {
this.currentClockState = advanceRuntimeClockState(
this.currentClockState,
simulationDt
);
if (this.sceneReady) {
this.syncRuntimeScheduleToCurrentClock();
}
this.syncRuntimeScheduleToCurrentClock();
this.applyDayNightLighting();
this.clockPublishAccumulator += simulationDt;