diff --git a/src/ship/ship.rs b/src/ship/ship.rs index cc21d87..d646ac5 100644 --- a/src/ship/ship.rs +++ b/src/ship/ship.rs @@ -331,12 +331,13 @@ impl ServerState for ShipServerState { } fn on_disconnect(&mut self, id: ClientId) -> Vec<(ClientId, SendShipPacket)> { + // TODO: don't unwrap! let client = self.client_location.get_local_client(id).unwrap(); let neighbors = self.client_location.get_client_neighbors(id).unwrap(); let pkt = match self.client_location.get_area(id).unwrap() { RoomLobby::Room(room) => { - if let 0 = neighbors.len() { + if neighbors.len() == 0 { self.rooms[room.0] = None; } let leader = self.client_location.get_room_leader(room).unwrap();