This will be useful for various things, including in particular
recovering from things stuck under occulters, and making the UI "b"
work properly.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fn op(&self, a: ApiPieceOpArgs) -> PieceUpdate {
let ApiPieceOpArgs { gs,piece, .. } = a;
let gpc = gs.pieces.byid_mut(piece).unwrap();
- if gpc.occult.is_active() { throw!(OE::Occultation) }
+ if gpc.occult.is_active() {
+ if self.z >= gpc.zlevel.z { throw!(OE::Occultation) }
+ }
gpc.zlevel = ZLevel { z: self.z.clone(), zg: gs.gen };
let update = PieceUpdateOp::SetZLevel(());
(WhatResponseToClientOp::Predictable,