aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/lib/Cafp/Game.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/lib/Cafp/Game.hs b/server/lib/Cafp/Game.hs
index f0d4d47..8b675e1 100644
--- a/server/lib/Cafp/Game.hs
+++ b/server/lib/Cafp/Game.hs
@@ -23,7 +23,7 @@ import Cafp.Messages
import Control.Lens (Lens', at, iall, imap, ix, orOf,
over, to, (%%=), (%=), (&), (+=),
(.=), (.~), (^.), (^..), (^?),
- _1, _2, _3)
+ _1, _2, _3, (%~))
import Control.Lens.TH (makeLenses, makePrisms)
import Control.Monad (guard)
import Control.Monad.State (State, execState, modify,
@@ -184,8 +184,12 @@ stepGame game = case game ^. gameTable of
pure (proposal, [pid])
(shuffled, seed) = shuffle
(V.fromList $ HMS.toList proposalsMap) (game ^. gameSeed) in
- game & gameSeed .~ seed
+ game
+ & gameSeed .~ seed
& gameTable .~ TableVoting black shuffled HMS.empty
+ & gamePlayers %~ imap (\pid player ->
+ let used = fromMaybe V.empty $ HMS.lookup pid proposals in
+ player & playerHand %~ V.filter (not . (`V.elem` used)))
| otherwise -> game
TableVoting black shuffled votes
-- Everyone has voted.