X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fmodules%2FNeonFun.mod%2Fgame_blackjack.c;h=f2576dc74507718294fc1e225676c5e2d27e7946;hp=6c69934a63c12e45de2ccd948ead6c225d4f464c;hb=3c0e6955ae76d93c211428d5c5e764f49b767618;hpb=9f992f346db24a642e3fe5362ae377ebe9002aa7 diff --git a/src/modules/NeonFun.mod/game_blackjack.c b/src/modules/NeonFun.mod/game_blackjack.c index 6c69934..f2576dc 100644 --- a/src/modules/NeonFun.mod/game_blackjack.c +++ b/src/modules/NeonFun.mod/game_blackjack.c @@ -201,6 +201,7 @@ int bj_get_player_card_points(struct bj_player *player) { static void bj_print_player_cards(struct bj_player *player, char *cards_buf) { struct bj_card *card; int cards_bufpos = 0; + cards_buf[0] = '\0'; for(card = player->cards; card; card = card->next) { int cardcolor = 1; char *cardchar = ""; @@ -307,7 +308,8 @@ void bj_action_take_card(struct bj_game *game, struct bj_player *player) { } reply(game->textbot, player->chanuser->user, "NF_BJ_TAKE", cardbuf, cardpoints); bj_show_player_cards(game, player); - if(points + cardpoints > 21) + points = bj_get_player_card_points(player); + if(points > 21) reply(game->textbot, player->chanuser->user, "NF_BJ_POINTS_EXCEEDED"); game->timer = timeq_add(30, module_id, bj_player_timeout, game); }