chiark / gitweb /
hidden: do not occult pieces which aren't can_occultable
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 7 Mar 2021 22:44:34 +0000 (22:44 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 10 Mar 2021 21:55:20 +0000 (21:55 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/hidden.rs

index 037c358022b4542c7748872a2aacfea5e19ce974..9856354749a15062472e1600b4843adb215c512e 100644 (file)
@@ -583,6 +583,10 @@ fn recalculate_occultation_general<
             // prevent occulting pieces being occulted
             // (also prevents reflexive occultation)
             return None
+          } else if ipc.occultable().is_none() {
+            // if we cannot make it look identical to the others, we
+            // cannot occult it beause we can't hide its identity
+            return None
           } else if occ.in_region(gpc.pos) {
             Some(Occulted { occid, occ })
           } else {