Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FiberedSkies committed Jan 27, 2025
1 parent 57a67b1 commit 065329e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/worlds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,14 @@ impl World {
}

loop {
if let Some(cmd) = cmd_rx.recv().await {
match cmd {
ControlCommand::Pause => self.pause()?,
ControlCommand::Resume => self.resume()?,
ControlCommand::SetTimeScale(scale) => self.rescale_time(scale),
ControlCommand::Quit => break,
if live {
if let Some(cmd) = cmd_rx.recv().await {
match cmd {
ControlCommand::Pause => self.pause()?,
ControlCommand::Resume => self.resume()?,
ControlCommand::SetTimeScale(scale) => self.rescale_time(scale),
ControlCommand::Quit => break,
}
}
}
if *self.pause_rx.borrow() {
Expand Down Expand Up @@ -349,12 +351,14 @@ impl World {
break;
}
}
if let Ok(cmd) = cmd_rx.try_recv() {
match cmd {
ControlCommand::Pause => self.pause()?,
ControlCommand::Resume => self.resume()?,
ControlCommand::Quit => break,
ControlCommand::SetTimeScale(scale) => self.rescale_time(scale),
if live {
if let Some(cmd) = cmd_rx.recv().await {
match cmd {
ControlCommand::Pause => self.pause()?,
ControlCommand::Resume => self.resume()?,
ControlCommand::SetTimeScale(scale) => self.rescale_time(scale),
ControlCommand::Quit => break,
}
}
}
} else {
Expand Down

0 comments on commit 065329e

Please # to comment.