mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-25 19:57:09 +00:00
Merge pull request #374 from 403-Fruit/patch-1
Blackjack game: fix bug counting more than one ace
This commit is contained in:
commit
2f567f3c3f
1 changed files with 2 additions and 2 deletions
|
@ -173,7 +173,7 @@ uint8_t hand_count(const Card* cards, uint8_t count) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(uint8_t i = 0; i < aceCount; i++) {
|
for(uint8_t i = 0; i < aceCount; i++) {
|
||||||
if((score + 11) <= 21)
|
if((score + 11 + (aceCount - 1)) <= 21)
|
||||||
score += 11;
|
score += 11;
|
||||||
else
|
else
|
||||||
score++;
|
score++;
|
||||||
|
@ -350,4 +350,4 @@ void add_hand_region(Hand* to, Hand* from) {
|
||||||
add_to_hand(to, from->cards[i]);
|
add_to_hand(to, from->cards[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue