From f13314e3da05316241f99aef26ee72e44138a47f Mon Sep 17 00:00:00 2001 From: Capucho Date: Tue, 3 Mar 2020 21:26:59 +0000 Subject: [PATCH] Fixed the erroneous load on pause --- voxygen/src/session.rs | 4 ++++ voxygen/src/singleplayer.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 7670eb1b1e..ba92e95cdd 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -383,6 +383,10 @@ impl PlayState for SessionState { if global_state.singleplayer.is_none() || !global_state.singleplayer.as_ref().unwrap().is_paused() { + log::warn!( + "{}", + global_state.singleplayer.as_ref().unwrap().is_paused() + ); // Perform an in-game tick. if let Err(err) = self.tick(clock.get_avg_delta()) { global_state.info_message = diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index d2538c6bf6..28c7165148 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -57,12 +57,12 @@ impl Singleplayer { } /// Returns wether or not the server is paused - pub fn is_paused(&self) -> bool { self.paused.load(Ordering::Relaxed) } + pub fn is_paused(&self) -> bool { self.paused.load(Ordering::SeqCst) } /// Pauses if true is passed and unpauses if false (Does nothing if in that /// state already) pub fn pause(&self, state: bool) { - self.paused.load(Ordering::SeqCst); + self.paused.store(state, Ordering::SeqCst); let _ = self.sender.send(Msg::Pause(state)); } }