From: Ian Jackson Date: Sun, 14 Feb 2021 00:00:09 +0000 (+0000) Subject: hand: Fixes to track claiming and unclaiming X-Git-Tag: otter-0.4.0~495 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2655efbcd34ed11776b4b64cb1832e48c9a535cf;p=otter.git hand: Fixes to track claiming and unclaiming Signed-off-by: Ian Jackson --- diff --git a/src/pieces.rs b/src/pieces.rs index b74f6f67..a700bef7 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -368,14 +368,14 @@ impl Piece for Hand { def_key: 'C', opname: "deactivate".to_owned(), desc: Html::lit("Deactivate hand"), - wrc: WRC::Unpredictable, + wrc: WRC::UpdateSvg, }} else { UoDescription { kind: UoKind:: Piece, def_key: 'C', opname: "claim".to_owned(), desc: Html::lit("Claim this as your hand"), - wrc: WRC::Unpredictable, + wrc: WRC::UpdateSvg, }} }) } diff --git a/templates/script.ts b/templates/script.ts index d32f8c9c..4c957928 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -378,7 +378,7 @@ function some_keydown(e: KeyboardEvent) { f(uo); return; } - if (!(uo.kind == 'Global' || uo.kind == 'GlobalExtra')) + if (!(uo.kind == 'Global' || uo.kind == 'GlobalExtra' || uo.kind == 'Piece')) throw 'bad kind '+uo.kind; if (uo.wrc == 'UpdateSvg' || uo.wrc == 'Predictable') {