Tweak error messages of /callvote kick
authorWuzzy <Wuzzy2@mail.ru>
Fri, 26 Oct 2018 19:40:43 +0200
changeset 14012 4ae01eabf611
parent 14011 b9b1d74b7fef
child 14013 863604736cf5
Tweak error messages of /callvote kick
gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Fri Oct 26 19:53:07 2018 +0200
+++ b/gameServer/HWProtoInRoomState.hs	Fri Oct 26 19:40:43 2018 +0200
@@ -455,7 +455,14 @@
 
 handleCmd_inRoom ["CALLVOTE", "KICK"] = do
     cl <- thisClient
-    return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "/callvote kick: You need to specify a nickname."]]
+    rm <- thisRoom
+    return
+        [AnswerClients [sendChan cl] ["CHAT", nickServer,
+        if isJust $ masterID rm then
+            loc "/callvote kick: This is only allowed in rooms without a room master."
+        else
+            loc "/callvote kick: You need to specify a nickname."
+        ]]
 
 handleCmd_inRoom ["CALLVOTE", "KICK", nickname] = do
     (thisClientId, rnc) <- ask