X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fmodules%2FNeonFun.mod%2Fgame_uno.c;h=96f57927f555801b2b19ffbab7efb8669d3be837;hb=c8e7ce1c57afaebf3996a6712c45f4c89c34ba44;hp=0fc95026f7a8a0f578e9fa32b30ad7027d1cc68e;hpb=9fc84e5ecbdc204ee45bfc72bf891d7102756508;p=NeonServV5.git diff --git a/src/modules/NeonFun.mod/game_uno.c b/src/modules/NeonFun.mod/game_uno.c index 0fc9502..96f5792 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; @@ -634,19 +636,6 @@ void uno_event_part(struct ChanUser *chanuser) { } } -void uno_event_quit(struct UserNode *user) { - struct uno_game *game; - for(game = uno_active_games; game; game = game->next) { - struct uno_player *player; - for(player = game->player; player; player = player->next) { - if(player->chanuser->user == user) { - uno_free_player(player, game->deck); - break; - } - } - } -} - void uno_event_freechan(struct ChanNode *chan) { struct uno_game *game; for(game = uno_active_games; game; game = game->next) {