Remove the Refiner and Stone cutter; old saves refund them on load (t4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 16:39:27 -04:00
co-authored by Claude Opus 5.5
parent 8d9e9c546b
commit f4eddfb82b
12 changed files with 70 additions and 152 deletions
+7 -1
View File
@@ -74,7 +74,13 @@ function deserializeWorld(meta, buffers) {
if (p >= P_TU && p <= P_TR) markPow(i, true);
}
for (let i = 0; i < N; i++) { const m = mat[i]; if (m === BELTL || m === BELTR || m === SHAFT) markPow(i, true); }
for (const m of meta.machines) { const mm = addMachine(m.type, m.bx, m.by, m.dir); mm.on = m.on !== false; if (m.type === 'silo') { mm.sm = m.sm || 0; mm.sn = m.sn || 0; mm.open = !!m.open; } }
// Old machines removed from the game are refunded.
const removedMachines = { refiner: 120, cutter: 90 };
for (const m of meta.machines) {
if (!Object.hasOwn(PIECE_BY_ID, m.type)) { money += Object.hasOwn(removedMachines, m.type) ? removedMachines[m.type] : 0; continue; }
const mm = addMachine(m.type, m.bx, m.by, m.dir); mm.on = m.on !== false;
if (m.type === 'silo') { mm.sm = m.sm || 0; mm.sn = m.sn || 0; mm.open = !!m.open; }
}
molds = [];
for (const m of meta.molds) molds.push(newMoldRecord(m.kind, m.x, m.y, m.wall));
for (const [m, x, y, T] of meta.ents || []) { const e = { m, x, y, ix: x, iy: y, vx: 0, vy: 0, T, rest: 0 }; ents.push(e); entMark(e, 1); }