Permalink
Browse files

Merge pull request #63 from bilts/fix-53-courtyard

Fix Courtyard's choice of card to put back on deck
  • Loading branch information...
2 parents 423e217 + e03bd75 commit 1943bba8f297ceee880fdf31c0bbbeacc72bc783 @rspeer committed Jan 20, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 basicAI.coffee
View
@@ -633,7 +633,7 @@ class BasicAI
for card in my.hand
if (card.isTreasure) and (not (card in treasures))
treasures.push card
- treasures.sort( (x, y) -> x.coins - y.coins)
+ treasures.sort( (x, y) -> y.coins - x.coins)
# Get the margin of how much money we're willing to discard.
margin = my.ai.coinLossMargin(state)
@@ -1115,7 +1115,7 @@ class BasicAI
# TODO: do we need an equivalent for potions?
coinLossMargin: (state) ->
newState = this.pessimisticBuyPhase(state)
- coins = newState.coins
+ coins = newState.current.coins
cardToBuy = newState.getSingleBuyDecision()
return 0 if cardToBuy is null
[coinsCost, potionsCost] = cardToBuy.getCost(newState)

0 comments on commit 1943bba

Please sign in to comment.