From 883108176c50537a94b84744948bf66d70066193 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 12 Feb 2021 01:17:11 +0000 Subject: [PATCH] hidden: Make recaulculate_occultation take just plain vanilla Signed-off-by: Ian Jackson --- src/hidden.rs | 26 +++++++++++--------------- src/imports.rs | 1 + 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/hidden.rs b/src/hidden.rs index dfce8d16..b40d3687 100644 --- a/src/hidden.rs +++ b/src/hidden.rs @@ -210,16 +210,14 @@ pub fn massage_prep_piecestate( // xxx this means this only happens on ungrab I think ? #[throws(InternalError)] -pub fn recalculate_occultation Vec + Sync> - ( - gs: &mut GameState, - who_by: Html, - ipieces: &PiecesLoaded, - piece: PieceId, - vanilla_wrc: WhatResponseToClientOp, - vanilla_uo: PieceUpdateOp<(),()>, - vanilla_log: LF, - ) -> PieceUpdate +pub fn recalculate_occultation( + gs: &mut GameState, + who_by: Html, + ipieces: &PiecesLoaded, + piece: PieceId, + vanilla: PUFOS, +) + -> PieceUpdate { // fallible part let (update, occids): (_, OldNew>) = { @@ -250,9 +248,7 @@ pub fn recalculate_occultation Vec + Sync> ].into(); let occids = occulteds.map(|h| h.as_ref().map(|occ| occ.occid)); - if occids.old() == occids.new() { - return (vanilla_wrc, vanilla_uo, vanilla_log()).into() - } + if occids.old() == occids.new() { return vanilla.into(); } /* #[throws(IE)] @@ -319,10 +315,10 @@ pub fn recalculate_occultation Vec + Sync> }; let most_obscure = most_obscure.unwrap_or(&OccK::Visible); // no players! - + let log = match most_obscure { OccK::Visible => { - vanilla_log() + vanilla.2 } OccK::Scrambled | OccK::Displaced{..} => { let face = ipc.nfaces() - 1; diff --git a/src/imports.rs b/src/imports.rs index b2e852f9..df047818 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -134,6 +134,7 @@ pub type POEPP = PieceOpErrorPartiallyProcessed; // updates.rs pub type PUE = PreparedUpdateEntry; +pub type PUFOS = PieceUpdateFromOpSimple; pub type PUO = PieceUpdateOp; pub type PUOs = PieceUpdateOps; pub type WRC = WhatResponseToClientOp; -- 2.30.2