From b8447bc121ebe7b1d5f1f1313da45c5b11d9a958 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 12 Feb 2023 22:15:09 +0100 Subject: [PATCH] what the fuck --- kubi/src/networking.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/kubi/src/networking.rs b/kubi/src/networking.rs index 4b5a8ff..65fd538 100644 --- a/kubi/src/networking.rs +++ b/kubi/src/networking.rs @@ -37,7 +37,9 @@ pub fn create_client( pub fn connect_client( mut client: UniqueViewMut ) { - client.0.connect().unwrap(); + if !client.0.has_not_made_connection_attempts() { + client.0.connect().unwrap(); + } } pub fn update_client( @@ -63,18 +65,12 @@ pub fn insert_client_events( pub fn update_networking() -> Workload { ( create_client.run_if_missing_unique::(), - connect_client.run_if(client_needs_connect_call), + connect_client, update_client, insert_client_events, ).into_workload() } -fn client_needs_connect_call( - client: UniqueView, -) -> bool { - client.0.has_not_made_connection_attempts() -} - pub fn is_multiplayer( game_type: UniqueView ) -> bool {