fixed 4wins, uno ranking output and some language strings
authorpk910 <philipp@zoelle1.de>
Thu, 22 Mar 2012 23:33:56 +0000 (00:33 +0100)
committerpk910 <philipp@zoelle1.de>
Thu, 22 Mar 2012 23:50:00 +0000 (00:50 +0100)
src/modules/NeonFun.mod/game_4wins.c
src/modules/NeonFun.mod/game_uno.c
src/modules/NeonServ.mod/bot_NeonServ.c

index 88503a184cec1bfcc15869a88eb10c66d075db3a..6698eaea649cef2ef052a14155c63b578b900b09 100644 (file)
@@ -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;
     }
index 1500c243b44fdb0e091b26571f8c957733cb642f..0fc95026f7a8a0f578e9fa32b30ad7027d1cc68e 100644 (file)
@@ -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;
index d1b9a5b9c93ab490b7d7a46caf48b53d3cf6e96e..6fa5236862437e0e059533ec0839721dc71cce97 100644 (file)
@@ -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} */