fix broken messages on lobby join
authoralfadur
Mon, 06 May 2019 22:57:49 +0300
changeset 14891 e72d8c2299dd
parent 14890 ff2c19a462de
child 14892 444ed0622348
fix broken messages on lobby join
rust/hedgewars-server/src/server/handlers/common.rs
--- a/rust/hedgewars-server/src/server/handlers/common.rs	Mon May 06 21:33:48 2019 +0200
+++ b/rust/hedgewars-server/src/server/handlers/common.rs	Mon May 06 22:57:49 2019 +0300
@@ -90,7 +90,9 @@
 
     response.add(LobbyJoined(all_nicks).send_self());
     for (flag, nicks) in &mut flag_selectors {
-        response.add(ClientFlags(add_flags(&[*flag]), replace(nicks, vec![])).send_self());
+        if !nicks.is_empty() {
+            response.add(ClientFlags(add_flags(&[*flag]), replace(nicks, vec![])).send_self());
+        }
     }
 
     response.add(server_msg.send_self());