[Question] Furniture

From: Dust (dustlos@hotmail.com)
Date: 04/08/01


I recently put in the recent chairs patch and everything works fine, however
there is an occasional crash and I'm not too sure what is actually causing
it so I'll just paste in some of the relevant parts here... This has been
really frustrating and any advice is appreciated greatly




>> The gdb of the circle and core files
Core was generated by `bin/circle -q 9990'.
Program terminated with signal 11, Segmentation fault.
#0  show_obj_to_char (object=0x83730a0, ch=0x841cac0, mode=0) at
act.informative.c:141
141           for (temp = OBJ_SAT_IN_BY(object); temp; temp =
NEXT_SITTING(temp)){


>> The relevant code in act.info
     if (SITTING(ch)) {
       temp = OBJ_SAT_IN_BY(object);
       for (next = temp; next!= NULL; next = NEXT_SITTING(next)){
         if (next == ch)
           found = 1;
       }
       if (found == 1) {
         if (GET_POS(ch) == POS_SITTING)
           sprintf(buf, "&gYou are sitting %s %s.&n",
furniture_bits[GET_OBJ_VAL(object, 2)],
          (CAN_SEE_OBJ(ch, object) ? object->short_description :
"something"));
          .......etc


>> In struct obj_data we added this:
   struct char_data *sitting_here;   /* Who is sitting in it (null if none)
*/

>> In struct char_special_data this was added
  struct obj_data *chair;          /* Object the char is sitting in */
  struct char_data *next_in_chair; /* The next person in the chair */\

>> Macros from utils.h
void char_from_chair(struct char_data *ch);
#define SITTING(ch)          ((ch)->char_specials.chair)
/* What obj the char is sitting on */
#define NEXT_SITTING(ch)     ((ch)->char_specials.next_in_chair)  /* linked
list of other chars sitting on that chair */
#define OBJ_SAT_IN_BY(obj)   ((obj)->sitting_here)                       /*
who is sitting on the chair */

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST