summaryrefslogtreecommitdiff
path: root/src/dashboard.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-04-05 08:58:01 -0500
committertom barrett <spalf0@gmail.com>2018-04-05 08:58:01 -0500
commit20d2ab63c46d97a9dcc4df848dd728419d0031f9 (patch)
tree9028b3a9670f80ebe762c391e90db8ca3d90de2d /src/dashboard.rs
parent9c094a4ef0a8db67e0f58904d46e6ad076415278 (diff)
-changed how everything is referenced by its name now, instead of the index, -also added targeting status to the navigation panel
Diffstat (limited to 'src/dashboard.rs')
-rw-r--r--src/dashboard.rs6
1 files changed, 3 insertions, 3 deletions
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<TcpStream>) {
impl Connection {
pub fn server_dashboard(&mut self, masses : &mut Vec<Box<Mass>>) -> 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,
}