Skip to content

Commit

Permalink
fix(plugin25): do not count market buy as card action
Browse files Browse the repository at this point in the history
Fixes swap carrots being incorrectly disallowed
  • Loading branch information
xeruf committed Jun 19, 2024
1 parent 17a8907 commit 979cbdf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugin2025/src/main/kotlin/sc/plugin2025/GameState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ data class GameState @JvmOverloads constructor(
} ?: move.perform(this)
if(mist != null)
throw InvalidMoveException(mist, move)
currentPlayer.lastAction = if(move is Advance) move.getCards().lastOrNull() ?: move else move
currentPlayer.lastAction =
if(move is Advance && currentField != Field.MARKET)
move.getCards().lastOrNull() ?: move
else move
turn++
awardPositionFields()
if(!moveIterator().hasNext()) {
Expand Down

0 comments on commit 979cbdf

Please sign in to comment.