diff --git a/battlefox/src/mapvote.rs b/battlefox/src/mapvote.rs index 11afb9f..72f802a 100644 --- a/battlefox/src/mapvote.rs +++ b/battlefox/src/mapvote.rs @@ -79,6 +79,7 @@ struct Inner { #[derive(Debug)] pub struct Mapvote { + /// Is `None` exactly when mapvote is currently disabled. inner: Mutex>, mapman: Arc, vips: Arc, @@ -1046,12 +1047,14 @@ impl Mapvote { if let Some(inner) = &mut *lock { info!("Voting ended. Votes: {:#?}", &inner.votes); let profile = inner.to_profile(); + let anim_override_override = inner.anim_override_override.clone(); // get each player's votes, so we can simulate how the votes go later. let assignment = inner.to_assignment(); - // inner.set_up_new_vote(self.config.n_options, Some(recent_maps)); - Some((profile, assignment, inner.anim_override_override.clone())) + // We set the `inner` to None, which will disable the mapvote until it is re-enabled some time. + *lock = None; + Some((profile, assignment, anim_override_override)) } else { None }