From 81cb6b88d15cb074aa793f50e7c6ed513970a2a1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 20 Mar 2021 18:45:18 +0000 Subject: [PATCH] pass &InstanceRef to held_change_hook Signed-off-by: Ian Jackson --- daemon/api.rs | 1 + src/gamestate.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/daemon/api.rs b/daemon/api.rs index 13ee5246..3fa37d88 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -185,6 +185,7 @@ fn api_piece_op(form: Json>) if gpc.held != was_held; if let Some(ipc) = &g.ipieces.get(piece); if let Ok(unprepared) = ipc.direct_trait_access().held_change_hook( + &iad.gref, &mut g.gs.pieces, was_held, ).map_err(|e| error!("internal error on change hook: {:?}", e)); diff --git a/src/gamestate.rs b/src/gamestate.rs index 56b35c07..85daf5b6 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -146,6 +146,7 @@ pub trait PieceTrait: OutlineTrait + Send + Debug + 'static { /// Piece is responsible for dealing with the possibility that they /// may be occulted! fn held_change_hook(&self, + _ig: &InstanceRef, _gpieces: &mut GPieces, _was_held: Option) -> UnpreparedUpdates { None } -- 2.30.2