From 9fc84e5ecbdc204ee45bfc72bf891d7102756508 Mon Sep 17 00:00:00 2001 From: pk910 Date: Fri, 23 Mar 2012 00:33:56 +0100 Subject: [PATCH] fixed 4wins, uno ranking output and some language strings --- src/modules/NeonFun.mod/game_4wins.c | 7 ++++--- src/modules/NeonFun.mod/game_uno.c | 2 +- src/modules/NeonServ.mod/bot_NeonServ.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/NeonFun.mod/game_4wins.c b/src/modules/NeonFun.mod/game_4wins.c index 88503a1..6698eae 100644 --- a/src/modules/NeonFun.mod/game_4wins.c +++ b/src/modules/NeonFun.mod/game_4wins.c @@ -78,7 +78,7 @@ int fourwins_check_win(struct fourwins_game *game, int x, int y) { else break; } - for(ix = x, iy = y; ix >= 0 && iy >= 0; ix--, iy--) { + for(ix = x-1, iy = y-1; ix >= 0 && iy >= 0; ix--, iy--) { if(game->matrix[ix][iy].field == field) fc++; else @@ -96,7 +96,7 @@ int fourwins_check_win(struct fourwins_game *game, int x, int y) { else break; } - for(ix = x, iy = y; ix >= 0 && iy < FOURWINS_MATRIX_HEIGHT; ix--, iy++) { + for(ix = x-1, iy = y+1; ix >= 0 && iy < FOURWINS_MATRIX_HEIGHT; ix--, iy++) { if(game->matrix[ix][iy].field == field) fc++; else @@ -148,7 +148,8 @@ void fourwins_free_game(struct fourwins_game *game) { if(prev) prev->next = game->next; else - fourwins_active_games->next = game->next; + fourwins_active_games = game->next; + break; } else prev = cgame; } diff --git a/src/modules/NeonFun.mod/game_uno.c b/src/modules/NeonFun.mod/game_uno.c index 1500c24..0fc9502 100644 --- a/src/modules/NeonFun.mod/game_uno.c +++ b/src/modules/NeonFun.mod/game_uno.c @@ -555,7 +555,7 @@ void uno_play_card(struct uno_game *game, struct uno_player *player, struct uno_ winner_count = 1; char rank_buf[20], won_buf[50], total_won_buf[50]; char *tmp, *tmp2; - for(cplayer = game->winner; cplayer->next; cplayer = cplayer->next) { + for(cplayer = game->winner; cplayer; cplayer = cplayer->next) { sprintf(rank_buf, "%d", winner_count++); content[0] = rank_buf; content[1] = cplayer->chanuser->user->nick; diff --git a/src/modules/NeonServ.mod/bot_NeonServ.c b/src/modules/NeonServ.mod/bot_NeonServ.c index d1b9a5b..6fa5236 100644 --- a/src/modules/NeonServ.mod/bot_NeonServ.c +++ b/src/modules/NeonServ.mod/bot_NeonServ.c @@ -77,7 +77,7 @@ static const struct default_language_entry msgtab[] = { {"NS_USERS_HEADER", "%s users from level %d to %d:"}, /* {ARGS: "#TestChan", 1, 500} */ {"NS_USERS_HEADER_MATCH", "%s users from level %d to %d matching %s:"}, /* {ARGS: "#TestChan", 1, 500, "Test*"} */ {"NS_USERS_HEADER_ACCESS", "Access"}, - {"NS_USERS_HEADER_ACCOUNT", "Accout"}, + {"NS_USERS_HEADER_ACCOUNT", "Account"}, {"NS_USERS_HEADER_SEEN", "Last Seen"}, {"NS_USERS_HEADER_STATE", "Status"}, {"NS_USERS_COUNT", "There are $b%d$b users in %s."}, /* {ARGS: 20, "#TestChan"} */ @@ -101,7 +101,7 @@ static const struct default_language_entry msgtab[] = { {"NS_MYACCESS_HEADER_MATCH", "Showing all channel entries for account $b%s$b matching %s:"}, /* {ARGS: "TestAuth", "#Test*"} */ {"NS_MYACCESS_HEADER_NAME", "Name"}, {"NS_MYACCESS_HEADER_ACCESS", "Access"}, - {"NS_MYACCESS_HEADER_FLAGS", "Flags"}, + {"NS_MYACCESS_HEADER_FLAGS", "Rights"}, {"NS_MYACCESS_HEADER_INFO", "Info"}, {"NS_MYACCESS_COUNT", "%s has access in $b%d$b channel(s) and is owner of $b%d$b channel(s)."}, /* {ARGS: "TestUser", 15, 5} */ {"NS_MYACCESS_COUNT_MATCH", "%s has access in $b%d$b channel(s) and is owner of $b%d$b channel(s) ($b%d$b channels matching your request)."}, /* {ARGS: "TestUser", 15, 5, 7} */ -- 2.20.1