function piece_moveable(p: PieceInfo) {
return p.moveable == 'Yes' || p.moveable == 'IfWresting' && wresting;
}
+function treat_as_pinned(p: { pinned: boolean }): boolean {
+ return p.pinned && !wresting;
+}
// ----- key handling -----
}
let p = pieces[piece];
- if (p.pinned && !wresting) continue;
+ if (treat_as_pinned(p)) continue;
if (p.held && p.held != us && !wresting) continue;
if (i > 0 && !piece_moveable(p))
continue;
if (c == null) return;
let clicked = c.clicked;
let held = c.held;
- let pinned = c.pinned;
let multigrab = c.multigrab;
special_count = null;
if (!shifted) {
ungrab_all_except(note_already);
}
- if (pinned && !wresting) {
+ if (treat_as_pinned(c)) {
let p = pieces[c.clicked[0]!]!;
add_log_message('That piece ('+p.desc+') is pinned to the table.');
return;