Belts: a backed-up heap stands still instead of the top sliding over the bottom

carryColumn stops at the first blocked grain on a belt, so a heap whose front
is backed up (a screw tube taking less than the belt brings, or a wall) no
longer shears. New t_conveyors checks and a belt-heap screenshot scene.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 19:07:28 -04:00
co-authored by Claude Opus 5.5
parent f540c5454f
commit 3e313e20eb
7 changed files with 80 additions and 11 deletions
+32
View File
@@ -157,4 +157,36 @@ r = JSON.parse(run('JSON.stringify(placeBlocks(BP_WALL, RSTONE, blockLine(20, 25
check('and a wall can replace them too', r.n === 2 && run('blockP[25*BW+20]') === run('BP_WALL') && run('!filterCfg.has(25*BW+20)'), JSON.stringify(r));
check('filters are a buildable piece with a price', run('PIECE_BY_ID.filter && !PIECE_BY_ID.filter.hidden && PIECE_BY_ID.filter.cost[0][0] === CASH'));
check('no trucks', run('typeof truck') === 'undefined');
// --- a backed-up heap must not shear over its bottom layer
// Watch belt beats, not settling between beats: copper must not ride over sand that stays put.
run(`globalThis.__carry = carryColumn;
globalThis.__shear = 0;
carryColumn = function(a, d, pass) {
const bottom = a, watch = [];
const sand = mat[a] === SAND && stamp[a] !== tickStamp && !occ[a];
if (sand) for (let i = a - W; i >= 0 && mat[i] !== EMPTY; i -= W) {
if (mat[i] === CUORE && stamp[i] !== tickStamp) watch.push(i);
}
__carry(a, d, pass);
if (sand && mat[bottom] === SAND && stamp[bottom] !== tickStamp)
for (const i of watch) if (mat[i] !== CUORE) __shear++;
};`);
for (const lift of [true, false]) {
fresh();
run('RS = 7; __shear = 0; for (let bx = 20; bx < 32; bx++) placeBlock(BP_BELT, 1, bx, 25, true);');
if (lift) run('for (let by = 15; by <= 25; by++) placeBlock(BP_TUBE, 0, 32, by, true);');
else run('for (let by = 10; by <= 25; by++) placeBlock(BP_WALL, RSTONE, 32, by, true);');
rect(run, 88, 94, 119, 99, run('SAND'));
rect(run, 88, 70, 119, 93, run('CUORE'));
ticks(run, 4000);
const shear = run('__shear');
check(lift ? 'a heap feeding an upward screw does not shear over stuck sand' : 'a heap against a wall does not shear over stuck sand', shear === 0, `${shear} copper steps over stationary sand in 4000 ticks`);
if (lift) {
const left = count(run, run('SAND'), 80, 0, 127, 99);
const lifted = count(run, run('SAND'), 128, 0, 319, 93);
check('the bottom sand leaves the belt through the upward screw too', left < 192 / 2 && lifted > 0, `${192 - left} of 192 sand left the belt, ${lifted} above its bottom layer at the lift`);
}
}
run('carryColumn = __carry;');
done();