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:
224cffa
)
api: Support loose grab op
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 14 Jul 2021 15:17:45 +0000
(16:17 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 14 Jul 2021 15:17:45 +0000
(16:17 +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 60643d5c72ae1202ed94305b0df362fd723ee2c1..34646e32165a7fba1baf1ccbed7090352cc9390b 100644
(file)
--- a/
daemon/api.rs
+++ b/
daemon/api.rs
@@
-283,6
+283,14
@@
api_route!{
}
impl op::Core as {
+ #[throws(ApiPieceOpError)]
+ fn conflict_loose_check(&self, gpc: &GPiece, client: ClientId)
+ -> ContinueDespiteConflict {
+ if gpc.occult.is_active() { throw!(Ia::Occultation ) }
+ if gpc.moveable != PieceMoveable::Yes { throw!(Ia::PieceImmoveable) }
+ if gpc.last_released != client { throw!(Ia::PieceHeld ) }
+ ContinueDespiteConflict
+ }
}
impl op::Simple as {