Shift-drag draws a line for belts and other transport pieces

Belts, filters, screw conveyors, shafts and pipe pieces never fill a rectangle;
a diagonal belt drag stays sloped with Shift held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 23:27:06 -04:00
co-authored by Claude Opus 5.5
parent 664e086969
commit 18528a7f73
10 changed files with 36 additions and 12 deletions
+2 -1
View File
@@ -99,7 +99,8 @@ function pieceCostNow(P, m = GAME.wallMat) {
function pieceCode(P, end = aimBlock()) {
if (P.id === 'belt' || P.filter) {
const a = GAME.drag || end;
if (GAME.drag && diagonalDrag(end.bx - a.bx, end.by - a.by) && !(typeof modShift === 'function' && modShift()))
// Shift changes nothing here: belts and filters only ever draw a line
if (GAME.drag && diagonalDrag(end.bx - a.bx, end.by - a.by))
return (P.filter ? BP_FILTER_UP : BP_BELT_UP) + ((end.bx - a.bx) * (end.by - a.by) > 0 ? 1 : 0);
if (end.bx === a.bx && end.by === a.by) return GAME.pieceShape && GAME.pieceShape[P.id] || P.code;
return P.code;