From: Ian Jackson Date: Sat, 30 Apr 2022 10:43:45 +0000 (+0100) Subject: multigrab: Check that the piece is not held X-Git-Tag: otter-1.1.0~415 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b3b9d016ffa45c09f14b3801e887a2cf01647bed;p=otter.git multigrab: Check that the piece is not held Signed-off-by: Ian Jackson --- diff --git a/daemon/api.rs b/daemon/api.rs index b9d5636a..be3ef8a6 100644 --- 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)? } }