Fix a couple issues
authorunC0Rr
Thu, 29 Sep 2022 16:28:52 +0200
changeset 15902 3360cc4c162d
parent 15901 4c58b320056c
child 15903 212e16c60bf5
Fix a couple issues
rust/hedgewars-server/src/handlers/common.rs
rust/hedgewars-server/src/server/demo.rs
--- a/rust/hedgewars-server/src/handlers/common.rs	Tue Sep 27 15:10:52 2022 +0300
+++ b/rust/hedgewars-server/src/handlers/common.rs	Thu Sep 29 16:28:52 2022 +0200
@@ -571,7 +571,9 @@
                 let seed = thread_rng().gen_range(0..1_000_000_000).to_string();
                 let cfg = GameCfg::Seed(seed);
                 response.add(cfg.to_server_msg().send_all().in_room(room_id));
-                room_control.set_config(cfg);
+                room_control
+                    .set_config(cfg)
+                    .expect("Apparently, you cannot just set room config");
             }
             VoteType::HedgehogsPerTeam(number) => {
                 let nicks = room_control.set_hedgehogs_number(number);
--- a/rust/hedgewars-server/src/server/demo.rs	Tue Sep 27 15:10:52 2022 +0300
+++ b/rust/hedgewars-server/src/server/demo.rs	Thu Sep 29 16:28:52 2022 +0200
@@ -135,7 +135,7 @@
         let mut teams = vec![];
         let mut hog_index = 7usize;
 
-        let mut messages = vec![];
+        let messages = vec![];
 
         while let Some(cmd) = read_command(&mut reader, &mut buffer)? {
             if let Some(index) = cmd.find(' ') {
@@ -302,7 +302,7 @@
     }
 
     let mut save_game_config = |name: &str, mut value: Vec<String>| {
-        map_config.push(Hs::Tuple(vec![
+        game_config.push(Hs::Tuple(vec![
             Hs::String(name.to_string()),
             Hs::List(value.drain(..).map(Hs::String).collect()),
         ]));