Bag: rock goes in as rubble, older saves convert, list shows everything held

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 16:53:40 -04:00
co-authored by Claude Opus 5.5
parent 569ec6e5b6
commit a671dcb59a
7 changed files with 34 additions and 3 deletions
+9
View File
@@ -148,4 +148,13 @@ const screwCatch = run(`(() => {
return {airborne, caught, bag: bag[SAND]};
})()`);
check('vacuum held under a screw arc catches its launched sand', screwCatch.airborne === 16 && screwCatch.caught === 16 && screwCatch.bag === 16, JSON.stringify(screwCatch));
// Rock in the bag: solids go in as what drilling them gives, and older saves holding solids load
// that way too, so the bag never holds something its list can't show.
flatWorld(run, 120, 80, 60);
check('putting rock in the bag stores its rubble', run('(() => { bag.fill(0); bagTotal = 0; bagAdd(BASALT, 10, true); bagAdd(CLAY, 5, true); return bag[BASALT] === 0 && bag[RBAS] === 10 && bag[CLAY] === 0 && bag[LCLAY] === 5 && bagTotal === 15; })()'));
check('a save holding solid rock loads it as rubble with the same total', run(`(() => {
bag.fill(0); bagTotal = 0; const s = serializeWorld(); s.meta.bag[BASALT] = 1000; s.meta.bag[CLAY] = 200; s.meta.bag[MSLAG] = 7;
deserializeWorld(s.meta, s.buffers);
return bag[BASALT] === 0 && bag[RBAS] === 1000 && bag[CLAY] === 0 && bag[LCLAY] === 200 && bag[MSLAG] === 7 && bagTotal === 1207;
})()`));
done();