diff --git a/src/ship/ship.rs b/src/ship/ship.rs index e1c61a6..cc21d87 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -336,9 +336,9 @@ impl ServerState for ShipServerState { let pkt = match self.client_location.get_area(id).unwrap() { RoomLobby::Room(room) => { - self.client_location.get_client_neighbors(id).map(|x| if x.len() == 0 { - self.rooms[room.0] = None - }); + if let 0 = neighbors.len() { + self.rooms[room.0] = None; + } let leader = self.client_location.get_room_leader(room).unwrap(); SendShipPacket::LeaveRoom(LeaveRoom::new(client.local_client.id(), leader.local_client.id())) },