From 1f132c88633f70e4c526131c3460f8b9bcbf2fed Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sun, 2 Jan 2022 20:13:11 -0800 Subject: [PATCH] timer tick now uses instruction flow --- src/main.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0b7b498..96a6d5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -56,16 +56,7 @@ fn main() { Err(_) => {}, } let tick_update = state.tick(); - if tick_update.0.is_some() { - let update = state.handle_update(tick_update.0.unwrap(), &hotkeys); - if update.0.is_some() {socket.send(update.0.unwrap().to_json().to_string());} - if update.1.is_some() {handle_instructions(update.1.unwrap(), &mut state, &socket, &hotkeys);} - } - if tick_update.1.is_some() { - let update = state.handle_update(tick_update.1.unwrap(), &hotkeys); - if update.0.is_some() {socket.send(update.0.unwrap().to_json().to_string());} - if update.1.is_some() {handle_instructions(update.1.unwrap(), &mut state, &socket, &hotkeys);} - } + handle_instructions(tick_update, &mut state, &socket, &hotkeys); } socket.close();