chiark / gitweb /
currency: Move slight, to prepare for occultation
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 19 May 2022 19:56:42 +0000 (20:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 19 May 2022 19:56:42 +0000 (20:56 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/currency.rs

index 2dcd0dcbb60bbbb2f92e38c2d0e7d3c25933fa7a..7bce5bdfd6070eb77baab9eeec644390364cd1df 100644 (file)
@@ -211,6 +211,14 @@ impl PieceTrait for Banknote {
       if mpiece == tpiece { throw!() }
       let mipc = ipieces.get(mpiece)?;
 
+      if mgpc.occult.passive_occid().is_some() {
+        // We don't do occultation yet.  But, anyway, we don't want to
+        // deal with this since it might mean we're totally invisible
+        // to our player!  When we do support this, call
+        // Occultation::get_kind ?
+        throw!();
+      }
+
       // Our position is within its bbox
       if ! mipc.show(show).abs_bbox(mgpc).ok()?.contains(tgpc.pos) { throw!() }
 
@@ -222,14 +230,6 @@ impl PieceTrait for Banknote {
       if mself.currency != tself.currency { throw!() }
       let currency = &mself.currency;
 
-      if mgpc.occult.passive_occid().is_some() {
-        // We don't do occultation yet.  But, anyway, we don't want to
-        // deal with this since it might mean we're totally invisible
-        // to our player!  When we do support this, call
-        // Occultation::get_kind ?
-        throw!();
-      }
-
       // We are in the ellipse inscribed in its bbox
       let delta = (tgpc.pos - mgpc.pos).ok()?.promote();
       let bbox_sz = mipc.show(show).bbox_approx().ok()?;