Re: [bug] bpl21 boards

From: George Greer (greerga@circlemud.org)
Date: 09/25/02


On Sun, 22 Sep 2002, Russell Ryan wrote:

>  for (; ind < num_of_msgs[board_type] - 1; ind++) {
>     MSG_HEADING(board_type, ind) = MSG_HEADING(board_type, ind + 1);
>+   MSG_HEADING(board_type, ind+1) = NULL;
>     MSG_SLOTNUM(board_type, ind) = MSG_SLOTNUM(board_type, ind + 1);
>+   MSG_SLOTNUM(board_type, ind + 1) = -1;
>     MSG_LEVEL(board_type, ind) = MSG_LEVEL(board_type, ind + 1);
>+   MSG_LEVEL(board_type, ind + 1) = 0;
>  }

That's a bit excessive.  How about this instead:

Index: boards.c
===================================================================
RCS file: /home/circledb/.cvs/circle/src/boards.c,v
retrieving revision 1.27
diff -u -p -r1.27 boards.c
--- boards.c    30 Apr 2002 21:43:48 -0000      1.27
+++ boards.c    23 Sep 2002 00:36:26 -0000
@@ -416,7 +416,11 @@ int Board_remove_msg(int board_type, str
     MSG_SLOTNUM(board_type, ind) = MSG_SLOTNUM(board_type, ind + 1);
     MSG_LEVEL(board_type, ind) = MSG_LEVEL(board_type, ind + 1);
   }
+  MSG_HEADING(board_type, num_of_msgs[board_type] - 1) = NULL;
+  MSG_SLOTNUM(board_type, num_of_msgs[board_type] - 1) = 0;
+  MSG_LEVEL(board_type, num_of_msgs[board_type] - 1) = 0;
   num_of_msgs[board_type]--;
+
   send_to_char(ch, "Message removed.\r\n");
   snprintf(buf, sizeof(buf), "$n just removed message %d.", msg);
   act(buf, FALSE, ch, 0, 0, TO_ROOM);

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT