Belts built after a tick reset join the network; pin tick in golden renders

A world started after a long session kept the old nextPowerBuild, so new
belts were never added until a reload. Treat a wait longer than 6 ticks as
stale. The golden test pins tick now that t45 animates belts from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cj2RPXdPykKMEz5BXXczsj
This commit is contained in:
2026-10-29 23:50:09 -04:00
co-authored by Claude Opus 5.5
parent af411d5b21
commit e605953661
4 changed files with 22 additions and 2 deletions
+2 -1
View File
@@ -47,7 +47,8 @@ function fanBlow(mm, sat) {
function machinesTick() {
procBlocksTick();
rackTick();
if (powerDirty && tick >= nextPowerBuild) { rebuildPower(); nextPowerBuild = tick + 6; }
// A new or loaded world restarts the tick count, so a wait longer than 6 ticks is stale.
if (powerDirty && (tick >= nextPowerBuild || nextPowerBuild > tick + 6)) { rebuildPower(); nextPowerBuild = tick + 6; }
if (brokenMachines.length) {
const ids = brokenMachines; brokenMachines = [];
for (const id of ids) if (machines[id]) removeMachine(id, false, true);