diff --git a/chat-cli/src/main.rs b/chat-cli/src/main.rs index b0a9d61986..f68a5b47e9 100644 --- a/chat-cli/src/main.rs +++ b/chat-cli/src/main.rs @@ -23,14 +23,7 @@ fn main() { // TODO: Remove or move somewhere else, this doesn't work immediately after connecting println!("Ping: {:?}", client.get_ping_ms()); - println!( - "Players online: {:?}", - client - .get_players() - .into_iter() - .map(|(e, p)| p) - .collect::>() - ); + println!("Players online: {:?}", client.get_players()); client.register(comp::Player::new("test".to_string(), None)); client.send_chat("Hello!".to_string()); diff --git a/client/src/lib.rs b/client/src/lib.rs index 3313836be1..2734ee7bf6 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -426,13 +426,13 @@ impl Client { } /// Get a vector of all the players on the server - pub fn get_players(&mut self) -> Vec<(EcsEntity, comp::Player)> { - ( - &self.state.ecs().entities(), - &self.state.ecs().read_storage::(), - ) + pub fn get_players(&mut self) -> Vec { + // TODO: Don't clone players. + self.state + .ecs() + .read_storage::() .join() - .map(|(e, p)| (e, p.clone())) + .map(|p| p.clone()) .collect() } }