Sticky materials slide freely on built surfaces (t61)

Stickiness gated every diagonal step, so clay lumps, snow, wood chunks,
ash and dirt crawled down sloped walls (a clay grain never got down a
20-piece slope). It now applies only grain against grain: a grain
resting on anything built always tries its diagonal step, so chutes
carry every material while heaps keep their shape. The random draw is
unchanged, so generated worlds stay the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 23:11:05 -04:00
co-authored by Claude Opus 5.5
parent 8ce71f478a
commit 664e086969
4 changed files with 24 additions and 1 deletions
+3 -1
View File
@@ -95,7 +95,9 @@ function powder(i, x, y, m, barriers = cleatChunks[(y >> 5) * CW + (x >> 5)]) {
return;
}
}
if (rnd() < STICK[m]) {
// stickiness is grain against grain: on anything built (a wall, a slope, a belt) every material
// slides freely, so a chute carries clay as well as sand while clay heaps stay steep
if (rnd() < STICK[m] || (PH[t] === PH_SOLID && !(flags[b] & F_NAT))) {
const d = (RS & 2) ? 1 : -1;
let nx = x + d;
if (nx >= 0 && nx < W && (!CORNER_SEAL || (PH[mat[b]] !== PH_SOLID && (!barriers || !cleatMask[b])) || (PH[mat[i + d]] !== PH_SOLID && (!barriers || !cleatMask[i + d]))) && (!barriers || (!cleatMask[i] && !cleatMask[b + d])) && enterFree(m, PH_POWDER, b + d, d, 1)) { move(i, b + d, x, y, nx, y + 1); return; }