summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hintz <t@thintz.com>2020-04-27 21:28:31 -0700
committerThomas Hintz <t@thintz.com>2020-04-27 21:28:31 -0700
commit70ed9465b86fc61a114c6d65067dfdfd83f0e61e (patch)
tree9bdc9e777bbe43edc7ed09d5bcf93e3ef9ab51ef
parent1f5b1e1eae6fbd7af6b56e73b0a12553fa527b4c (diff)
downloadfarm-70ed9465b86fc61a114c6d65067dfdfd83f0e61e.tar.gz
Ensuring advance-turn consistency.
-rw-r--r--src/server/farm.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/farm.scm b/src/server/farm.scm
index 0ba7961..ec623c2 100644
--- a/src/server/farm.scm
+++ b/src/server/farm.scm
@@ -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)))))