NoClient | NoPlayer(_) | GameBeingDestroyed
=> Status::NotFound,
OE::PieceHeld | OE::PieceGone |
- OE::OverlappingOccultation
+ OE::OverlappingOccultation | OE::Occultation
=> Status::Conflict,
InvalidZCoord | BadOperation | BadJSON(_)
=> Status::BadRequest,
&gs.occults, player, gpl, piece, gpc, p,
if gpc.pinned { "pinned" } else { "unpinned" },
)?;
+ forbid_piece_involved_in_occultation(&gpc)?;
gpc.pinned = self.0;
let update = PieceUpdateOp::Modify(());
(WhatResponseToClientOp::Predictable,
BadOperation,
#[error("overlapping occultation")]
OverlappingOccultation,
+ #[error("piece is occulting, or occulted")]
+ Occultation,
}
from_instance_lock_error!{OnlineError}
gpc.occult.passive.is_some() ||
gpc.occult.active.is_some()
}
+#[throws(OE)]
+pub fn forbid_piece_involved_in_occultation(gpc: &GPiece) {
+ if piece_involved_in_occultation(&gpc) { throw!(OE::Occultation) }
+}
pub fn vpiece_decode(
_gs: &GameState, // xxx
// xxx prevent addpiece and removepiece in places that would be occulted
// xxx this means this only happens on ungrab I think ?
-// xxx prevent occultation of pinned things / pinning of occulted things
// xxx prevent occultation scrambling of grasped things
#[throws(InternalError)]