piece)?
);
}
+ gpc.occult.passive_delete_hook(&mut gs.occults, piece);
ipc.p.into_inner().delete_hook(&gpc, gs);
}
if let Some(occilk) = ipc.occilk { ig.ioccults.ilks.dispose(occilk); }
impl PieceOccult {
pub fn is_active(&self) -> bool { self.active.is_some() }
pub fn passive_occid(&self) -> Option<OccId> { Some(self.passive?.occid) }
+ pub fn passive_delete_hook(&self, goccults: &mut GameOccults,
+ piece: PieceId) {
+ if_chain! {
+ if let Some(Passive { occid, notch }) = self.passive;
+ if let Some(occ) = goccults.occults.get_mut(occid);
+ then {
+ occ.notches.remove(piece, notch)
+ .unwrap_or_else(|e| error!("removing occulted piece {:?}", e));
+ }
+ }
+ }
}
impl Default for OccultationKind {
piece
}
-// xxx prevent addpiece and removepiece in places that would be occulted
-// xxx this means this only happens on ungrab I think ?
-
#[throws(InternalError)]
fn recalculate_occultation_general<
RD: Debug, // return data