From: Ian Jackson Date: Sat, 20 Mar 2021 18:47:41 +0000 (+0000) Subject: pass PieceId to held_change_hook X-Git-Tag: otter-0.5.0~627 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=02b67c9c3aa6383b55fb147d757d5d150d24e479;p=otter.git pass PieceId to held_change_hook Signed-off-by: Ian Jackson --- diff --git a/daemon/api.rs b/daemon/api.rs index 3fa37d88..859626e3 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -187,6 +187,7 @@ fn api_piece_op(form: Json>) if let Ok(unprepared) = ipc.direct_trait_access().held_change_hook( &iad.gref, &mut g.gs.pieces, + piece, was_held, ).map_err(|e| error!("internal error on change hook: {:?}", e)); then { unprepared } diff --git a/src/gamestate.rs b/src/gamestate.rs index 85daf5b6..75c57c10 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -148,6 +148,7 @@ pub trait PieceTrait: OutlineTrait + Send + Debug + 'static { fn held_change_hook(&self, _ig: &InstanceRef, _gpieces: &mut GPieces, + _piece: PieceId, _was_held: Option) -> UnpreparedUpdates { None }