chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de8cb49
)
script: raise: log a message when nothing oculd be raised
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 6 Jul 2021 00:57:05 +0000
(
01:57
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 6 Jul 2021 00:57:50 +0000
(
01:57
+0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts
patch
|
blob
|
history
diff --git
a/templates/script.ts
b/templates/script.ts
index d6a7acfb0cc672c4fa4559ffe5ec2b6cdf9d3eb5..d8cd1b0cf322c78207e123b1afc4ba4c283411c6 100644
(file)
--- a/
templates/script.ts
+++ b/
templates/script.ts
@@
-813,11
+813,16
@@
function pin_unpin(uo: UoRecord, newpin: boolean) {
keyops_local['raise'] = function (uo: UoRecord) { raise_targets(uo); }
function raise_targets(uo: UoRecord) {
+ let any = false;
for (let piece of uo.targets!) {
let p = pieces[piece]!;
if (p.pinned || !piece_moveable(p)) continue;
+ any = true;
piece_raise(piece, p, "NotYet");
}
+ if (!any) {
+ add_log_message('No pieces could be raised.');
+ }
}
function piece_raise(piece: PieceId, p: PieceInfo,