From 92a421eb34b7f3fddd8e6f122fefe91a25224d46 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 3 Oct 2020 11:46:29 +0100 Subject: [PATCH] cleanups for wresting/pinning Signed-off-by: Ian Jackson --- templates/script.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index 7eb4ce7a..940bed1e 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -419,11 +419,10 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { var piece = target.dataset.piece!; if (!piece) { return; } let p = pieces[piece]!; - if (p.pinned && !wresting && p.held!=us) return; - drag_cancel(); - let held = p.held; + drag_cancel(); + drag_pieces = []; if (held == us) { dragging = DRAGGING.MAYBE_UNGRAB; @@ -434,7 +433,11 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { if (tp.held != us) continue; drag_add_piece(tpiece,tp); } - } else if (held == null || wresting) { + } else if (held == null) { + if (p.pinned && !wresting) { + add_log_message('That piece is pinned to the table.'); + return; + } if (!shifted) { ungrab_all(); } -- 2.30.2