This is preparatory, to reduce diff noise. We're going to change the
way this works in a moment.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
}
}
-#[throws(ApiPieceOpError)]
-fn op_do_set_z(gpc: &mut GPiece, gen: Generation, z: &ZCoord) {
- if gpc.occult.is_active() {
- if z >= &gpc.zlevel.z { throw!(Ia::Occultation) }
- }
- gpc.zlevel = ZLevel { z: z.clone(), zg: gen };
-}
-
api_route!{
api_move, "/_/api/m",
struct ApiPieceMove(Pos);
}
}
+// ---------- 2-phase Z level setting ----------
+
+#[throws(ApiPieceOpError)]
+pub fn op_do_set_z(gpc: &mut GPiece, gen: Generation, z: &ZCoord) {
+ if gpc.occult.is_active() {
+ if z >= &gpc.zlevel.z { throw!(Ia::Occultation) }
+ }
+ gpc.zlevel = ZLevel { z: z.clone(), zg: gen };
+}
+
// ---------- log expiry ----------
impl GameState {