Downhill sloped belts draw as plain belts, ghosts and previews too
Downhill runs have no cleats, so they no longer draw the sidewall or ribs either: placed, as ghosts, or in the drag preview, which now knows the belt's direction. Uphill runs keep the wall and ribs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -149,7 +149,7 @@ function slopeWallAt(x, y, smooth = false) {
|
||||
for (let by = Math.max(0, (y >> 2) - 1); by <= Math.min(BH - 1, (y >> 2) + 3); by++)
|
||||
for (let bx = Math.max(0, (x >> 2) - 2); bx <= Math.min(BW - 1, (x >> 2) + 2); bx++) {
|
||||
const b = by * BW + bx;
|
||||
if (!isBelt(blockP[b]) || !isSlopeBelt(blockP[b])) continue;
|
||||
if (!isBelt(blockP[b]) || !isSlopeBelt(blockP[b]) || !slopeUphill(blockP[b], blockV[b])) continue; // downhill: a plain belt
|
||||
const sd = slopeWallShape(x + 0.5, y + 0.5, b);
|
||||
if (sd <= best) { best = sd; slopeWallOwner = b; }
|
||||
}
|
||||
|
||||
+2
-2
@@ -413,8 +413,8 @@ function drawWorld() {
|
||||
const i = y * W + x, n = (y >> 2) * BW + (x >> 2);
|
||||
if (n !== b && (mat[i] !== EMPTY || part[i] || mach[i] || occ[i] || blockP[n])) continue;
|
||||
sd = slopeBeltShape(x + 0.5, y + 0.5, b, joins, code);
|
||||
const rib = !isFilter(code) && slopePreviewCleat(x, y, b, code);
|
||||
if (sd > 0 && !rib && (isFilter(code) || slopeWallShape(x + 0.5, y + 0.5, b, code) > 0)) continue;
|
||||
const up = !isFilter(code) && slopeUphill(code, v), rib = up && slopePreviewCleat(x, y, b, code);
|
||||
if (sd > 0 && !rib && (!up || slopeWallShape(x + 0.5, y + 0.5, b, code) > 0)) continue;
|
||||
if (rib) sd = -0.1;
|
||||
}
|
||||
if (isSlope(code) && !slopeCell(code, dx, dy)) continue;
|
||||
|
||||
Reference in New Issue
Block a user