From 833a043a35d36c9089f11d87d992c2491a3f1213 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Sun, 9 Aug 2020 13:04:54 +0200 Subject: Fix discarded card play at end of age Resolves: https://github.com/joffrey-bion/seven-wonders/issues/36 --- .../src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt index da3ae5c7..34a8dd99 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt @@ -149,7 +149,9 @@ class Game internal constructor( */ fun playTurn(): TableState { makeMoves() - if (endOfAgeReached()) { + if (shouldStartPlayDiscardedTurn()) { + startPlayDiscardedTurn() + } else if (endOfAgeReached()) { executeEndOfAgeEvents() if (endOfGameReached()) { startEndGameTurn() @@ -157,12 +159,8 @@ class Game internal constructor( startNewAge() } } else { - if (shouldStartPlayDiscardedTurn()) { - startPlayDiscardedTurn() - } else { - rotateHandsIfRelevant() - startNewTurn() - } + rotateHandsIfRelevant() + startNewTurn() } return table.toTableState() } -- cgit