rust/hedgewars-server/src/handlers/inroom.rs
changeset 15522 4a0b06b03199
parent 15519 b3157d218ae2
child 15523 f4f6060b536c
--- a/rust/hedgewars-server/src/handlers/inroom.rs	Mon Dec 23 18:11:15 2019 +0300
+++ b/rust/hedgewars-server/src/handlers/inroom.rs	Mon Dec 23 18:55:25 2019 +0300
@@ -390,7 +390,7 @@
                     }
                 }
                 VoteType::Map(None) => {
-                    let names: Vec<_> = server.rooms[room_id].saves.keys().cloned().collect();
+                    let names: Vec<_> = server.room(room_id).saves.keys().cloned().collect();
                     if names.is_empty() {
                         Some("/callvote map: No maps saved in this room!".to_string())
                     } else {
@@ -422,7 +422,7 @@
                 None => {
                     let msg = voting_description(&kind);
                     let voting = Voting::new(kind, server.room_clients(client_id).collect());
-                    let room = &mut server.rooms[room_id];
+                    let room = server.room_mut(room_id);
                     room.voting = Some(voting);
                     response.add(server_chat(msg).send_all().in_room(room_id));
                     super::common::submit_vote(