Add error message for /callvote map if no maps are available
authorWuzzy <Wuzzy2@mail.ru>
Sat, 25 Aug 2018 21:24:34 +0200
changeset 13700 feda0d1da62c
parent 13699 e6523fe53d11
child 13701 bb68f721e666
Add error message for /callvote map if no maps are available
gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Sat Aug 25 21:12:10 2018 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Sat Aug 25 21:24:34 2018 +0200
@@ -456,9 +456,16 @@
 
 
 handleCmd_inRoom ["CALLVOTE", "MAP"] = do
+    -- Display list of available maps for voting
     cl <- thisClient
     s <- liftM (Map.keys . roomSaves) thisRoom
-    return [AnswerClients [sendChan cl] ["CHAT", nickServer, B.concat ["callvote map: ", B.intercalate ", " s]]]
+    return [AnswerClients [sendChan cl]
+        ["CHAT", nickServer,
+            if (not $ null s) then
+                (B.concat ["/callvote map: ", B.intercalate ", " s])
+            else
+                loc "/callvote map: No maps available."
+        ]]
 
 
 handleCmd_inRoom ["CALLVOTE", "MAP", roomSave] = do