From: pk910 Date: Tue, 27 Mar 2012 03:12:22 +0000 (+0200) Subject: fixed UNO game X-Git-Tag: v5.4~24 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=0276f41e2356699b023499a33bdb9b0d07cf9297 fixed UNO game --- diff --git a/src/modules/NeonFun.mod/cmd_neonfun_uno.c b/src/modules/NeonFun.mod/cmd_neonfun_uno.c index 47df483..b2ba1e6 100644 --- a/src/modules/NeonFun.mod/cmd_neonfun_uno.c +++ b/src/modules/NeonFun.mod/cmd_neonfun_uno.c @@ -47,6 +47,7 @@ CMD_BIND(neonfun_cmd_uno) { player->chanuser = chanuser; player->count = 0; player->cards = NULL; + player->timeout = 0; player->prev = last_player; player->next = NULL; last_player->next = player; diff --git a/src/modules/NeonFun.mod/game_uno.c b/src/modules/NeonFun.mod/game_uno.c index 0fc9502..0e2c028 100644 --- a/src/modules/NeonFun.mod/game_uno.c +++ b/src/modules/NeonFun.mod/game_uno.c @@ -479,7 +479,7 @@ struct uno_card *uno_parse_card(struct uno_game *game, struct uno_player *player int uno_check_card_valid(struct uno_game *game, struct uno_card *card) { if(game->take_cards_pending && card->card != game->top_card->card) return 1; - if(card->color == UNO_COLOR_BLACK) + if(card->color == UNO_COLOR_BLACK || game->top_card->color == UNO_COLOR_BLACK) return 0; if(card->color != game->top_card->color && card->card != game->top_card->card) return 1; @@ -510,6 +510,8 @@ void uno_play_card(struct uno_game *game, struct uno_player *player, struct uno_ uno_reply(game, NULL, "NF_UNO_USER_WIN", game->active_player->chanuser->user->nick); if(player->prev) player->prev->next = player->next; + else + game->player = player->next; if(player->next) player->next->prev = player->prev; player->next = NULL;