diff -r f4c51ab8f46d -r 5fb3bb2de9d2 gameServer/Votes.hs --- a/gameServer/Votes.hs Thu Mar 20 22:14:30 2014 +0400 +++ b/gameServer/Votes.hs Sun Mar 23 23:35:33 2014 +0400 @@ -31,7 +31,7 @@ where actOnVoting :: Voting -> Reader (ClientIndex, IRnC) [Action] actOnVoting vt = do - let (contra, pro) = L.partition snd $ votes vt + let (pro, contra) = L.partition snd $ votes vt let v = (length $ entitledToVote vt) `div` 2 + 1 if length contra >= v then @@ -67,7 +67,7 @@ let rs = Map.lookup roomSave (roomSaves rm) case rs of Nothing -> return [] - Just (mp, p) -> return [ModifyRoom $ \r -> r{params = p, mapParams = mp}] + Just (mp, p) -> return [Warning "ye!", ModifyRoom $ \r -> r{params = p, mapParams = mp}] startVote :: VoteType -> Reader (ClientIndex, IRnC) [Action] @@ -82,9 +82,11 @@ if isJust $ voting rm then return [] else - liftM ([ModifyRoom (\r -> r{voting = Just (newVoting vt){entitledToVote = uids}}) - , AnswerClients chans ["CHAT", "[server]", B.concat [loc "New voting started", ": ", voteInfo vt]] - ] ++ ) $ voted True + return [ + ModifyRoom (\r -> r{voting = Just (newVoting vt){entitledToVote = uids}}) + , AnswerClients chans ["CHAT", "[server]", B.concat [loc "New voting started", ": ", voteInfo vt]] + , ReactCmd ["VOTE", "YES"] + ] checkVotes :: StateT ServerState IO ()