timer tick now uses instruction flow

This commit is contained in:
Nickiel12 2022-01-02 20:13:11 -08:00
parent 2d2147f799
commit 1f132c8863

View file

@ -56,16 +56,7 @@ fn main() {
Err(_) => {}, Err(_) => {},
} }
let tick_update = state.tick(); let tick_update = state.tick();
if tick_update.0.is_some() { handle_instructions(tick_update, &mut state, &socket, &hotkeys);
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);}
}
} }
socket.close(); socket.close();