Fix scheme config parsing
authoralfadur
Wed, 04 Jul 2018 13:56:49 +0300
changeset 13446 d47514fd6c6a
parent 13445 30ee161d85d0
child 13447 c6a3784ff2c1
Fix scheme config parsing
gameServer2/src/protocol/parser.rs
--- a/gameServer2/src/protocol/parser.rs	Wed Jul 04 12:57:05 2018 +0300
+++ b/gameServer2/src/protocol/parser.rs	Wed Jul 04 13:56:49 2018 +0300
@@ -173,10 +173,9 @@
                 value: opt_param >>
                 (GameCfg::Ammo(name, value)))
     | do_parse!(tag!("SCHEME")   >> eol >>
-                name: a_line     >> eol >>
-                values: separated_list!(eol, a_line) >>
-                (GameCfg::Scheme(name,
-                    if values.is_empty() {None} else {Some(values)})))
+                name: a_line     >>
+                values: opt!(preceded!(eol, separated_list!(eol, a_line))) >>
+                (GameCfg::Scheme(name, values)))
     | do_parse!(tag!("FEATURE_SIZE") >> eol >>
                 value: u32_line    >>
                 (GameCfg::FeatureSize(value)))