gameServer/HWProtoInRoomState.hs
changeset 8428 73ab5a17ee55
parent 8422 ec41194d4444
child 8429 f814a7c2a318
--- a/gameServer/HWProtoInRoomState.hs	Wed Jan 23 04:48:04 2013 +0100
+++ b/gameServer/HWProtoInRoomState.hs	Wed Jan 23 23:54:01 2013 +0400
@@ -103,7 +103,7 @@
         let team = fromJust maybeTeam
 
         return $
-            if isNothing $ findTeam r then
+            if isNothing $ maybeTeam then
                 [Warning $ loc "REMOVE_TEAM: no such team"]
             else if clNick /= teamowner team then
                 [ProtocolError $ loc "Not team owner!"]
@@ -132,7 +132,9 @@
     return $
         if not $ isMaster cl then
             [ProtocolError $ loc "Not room master"]
-        else if hhNumber < 1 || hhNumber > 8 || isNothing maybeTeam || hhNumber > canAddNumber r + hhnum team then
+        else if isNothing maybeTeam
+            return []
+        else if hhNumber < 1 || hhNumber > 8 || hhNumber > canAddNumber r + hhnum team then
             [AnswerClients clChan ["HH_NUM", teamName, showB $ hhnum team]]
         else
             [ModifyRoom $ modifyTeam team{hhnum = hhNumber},