From: Ian Jackson Date: Sat, 20 Mar 2021 23:26:55 +0000 (+0000) Subject: hidden: Prevent occultation scrambling of grasped things X-Git-Tag: otter-0.5.0~590 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ed045f17ee6f120c7bce7d0e6dfd9b415c38d542;p=otter.git hidden: Prevent occultation scrambling of grasped things Signed-off-by: Ian Jackson --- diff --git a/src/hidden.rs b/src/hidden.rs index 84b2248e..9c1ea743 100644 --- a/src/hidden.rs +++ b/src/hidden.rs @@ -307,7 +307,6 @@ pub fn vpiece_decode( // xxx prevent addpiece and removepiece in places that would be occulted // xxx this means this only happens on ungrab I think ? -// xxx prevent occultation scrambling of grasped things #[throws(InternalError)] fn recalculate_occultation_general< diff --git a/src/vpid.rs b/src/vpid.rs index e17a0161..62e431c1 100644 --- a/src/vpid.rs +++ b/src/vpid.rs @@ -282,6 +282,8 @@ pub fn permute(occid: OccId, for (notch, nr) in occ.notches.table.iter_enumerated() { let piece = if let Some(p) = nr.piece() { p } else { continue }; + let gpc = if let Some(gpc) = gpieces.get(piece) { gpc }else{ continue }; + if gpc.held.is_some() { continue } let occilk = (|| Some(ipieces.get(piece)?.occilk.as_ref()?))(); let occilk = if let Some(o) = occilk { *o.borrow() } else { error!("{}", internal_error_bydebug(&(occid, &occ, &nr, piece)));