Skip to content

Commit

Permalink
fixed bug in hands with more than 2 cards
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswoodford committed Mar 15, 2012
1 parent 99b8649 commit a7d1751
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions public/js/decision.js
Expand Up @@ -63,13 +63,15 @@ $(function(){
this.options.currentAction = action;

var q = this.currentQuestion();
var cards = q.find('span.playing-card');
var hand = [
this.parseCard($(cards.get(0))),
this.parseCard($(cards.get(1)))
];
var dealer = this.parseCard($(cards.get(2)));

var cards = q.find('span.playing-card').toArray();
var dealer = this.parseCard($(cards.pop()));
var hand = [];
var parser = this;

$.each(cards, function(i, card) {
hand.push(parser.parseCard($(card)));
});

$.get(this.options.decisionUrl, {
strategy: this.options.decisionStrategy,
hand: hand.join(','),
Expand Down

0 comments on commit a7d1751

Please sign in to comment.