From 7f59480efd03aa69032bd52267073fe5451b5dc7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 19 May 2022 20:56:42 +0100 Subject: [PATCH] currency: Move slight, to prepare for occultation Signed-off-by: Ian Jackson --- src/currency.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/currency.rs b/src/currency.rs index 2dcd0dcb..7bce5bdf 100644 --- a/src/currency.rs +++ b/src/currency.rs @@ -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()?; -- 2.30.2