From ed045f17ee6f120c7bce7d0e6dfd9b415c38d542 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 20 Mar 2021 23:26:55 +0000 Subject: [PATCH] hidden: Prevent occultation scrambling of grasped things Signed-off-by: Ian Jackson --- src/hidden.rs | 1 - src/vpid.rs | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) 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))); -- 2.30.2