rust/hedgewars-server/src/server/handlers/common.rs
changeset 14789 18240b308505
parent 14787 0e64acbc3f8b
child 14790 e94fbf6cad2b
--- a/rust/hedgewars-server/src/server/handlers/common.rs	Thu Apr 11 19:30:22 2019 +0300
+++ b/rust/hedgewars-server/src/server/handlers/common.rs	Thu Apr 11 21:20:41 2019 +0300
@@ -227,7 +227,8 @@
         remove_client_from_room(client, room, response, msg);
 
         if !room.is_fixed() && room.master_id == None {
-            if let Some(new_master_id) = server.collect_room_clients(room_id).first().cloned() {
+            let new_master_id = server.room_clients(room_id).next();
+            if let Some(new_master_id) = new_master_id {
                 let new_master_nick = server.clients[new_master_id].nick.clone();
                 let room = &mut server.rooms[room_id];
                 room.master_id = Some(new_master_id);