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:
5b9368f
)
multigrab: Check that the piece is not held
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 30 Apr 2022 10:43:45 +0000
(11:43 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 30 Apr 2022 11:42:41 +0000
(12:42 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/api.rs
patch
|
blob
|
history
diff --git
a/daemon/api.rs
b/daemon/api.rs
index b9d5636a33d7d459ee4889cb897c73c3ee18f11a..be3ef8a601ced13e42b5e8a53fd1ed01b4fd4815 100644
(file)
--- a/
daemon/api.rs
+++ b/
daemon/api.rs
@@
-574,6
+574,8
@@
api_route!{
if ! a.ipc.special.multigrab { throw!(Ia::BadPieceStateForOperation) }
let pri = a.pri()?;
let y = pri.fully_visible().ok_or(Ia::Occultation)?;
+ let gpc = a.gs.pieces.byid_mut(a.piece)?;
+ if gpc.held != None { throw!(Ia::PieceHeld) }
a.ipc.show(y).op_multigrab(a, pri, self.n)?
}
}