From 20d2ab63c46d97a9dcc4df848dd728419d0031f9 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 5 Apr 2018 08:58:01 -0500 Subject: -changed how everything is referenced by its name now, instead of the index, -also added targeting status to the navigation panel --- src/dashboard.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dashboard.rs') diff --git a/src/dashboard.rs b/src/dashboard.rs index c4c3200..e552127 100644 --- a/src/dashboard.rs +++ b/src/dashboard.rs @@ -20,9 +20,9 @@ pub fn client_dashboard(mut buff_r : BufReader) { impl Connection { pub fn server_dashboard(&mut self, masses : &mut Vec>) -> bool { - let mut ship_string = masses[self.index].serialize(); - ship_string.push_str("\n"); - match self.stream.write(ship_string.as_bytes()) { + let ship = masses.iter().find(|ship| ship.name() == &self.name).unwrap(); + let send = ship.serialize() + "\n"; + match self.stream.write(send.as_bytes()) { Ok(_result) => true, Err(_error) => false, } -- cgit v1.2.3