Ensuring advance-turn consistency.

master
Thomas Hintz 5 years ago
parent 1f5b1e1eae
commit 70ed9465b8

@ -521,7 +521,10 @@
(if (all-players-finished game)
(safe-set! (game-state game) 'finished)
(let ((next (next-player game)))
(safe-set! (player-state player) 'turn-ended)
(for-each (lambda (p)
(when (not (eq? (player-state p) 'finished))
(safe-set! (player-state p) 'turn-ended)))
(game-players game))
(safe-set! (player-state next) 'pre-turn)
(safe-set! (game-current-player game) next)
(safe-set! (game-turn game) (+ (game-turn game) 1)))))

Loading…
Cancel
Save