Regarding list_obj_to_char()

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 10/09/97

if anyone has this in their mud (not sure if its stock or not)
i would like
someone to explain the list_obj_to_char() function to me (in private if

I'm trying to find a way to separate objs, like mobs are separated,
b/c i recently IMP'd ascii objsave files. (for a restring command)

anyway, it seems to group same VNUM objs together,
and i'm trying to find a way around it,
but so far all i've succeeding in doing
is blocking out certain objects from being shown.

maybe just send me a documented version back or something,
b/c for the life of me, i can't figure out why they did it this way.
i probably could always right my own version, but i'm no so sure i wanna do
that just yet.

Thanks again,

Akuma the Raging Coder

void list_obj_to_char(struct obj_data * list, struct char_data * ch, int mode,
                           bool show)
  struct obj_data *i, *j;
  char buf[10];
  bool found;
  int num;

  found = FALSE;
  for (i = list; i; i = i->next_content) {
      num = 0;
      for (j = list; j != i; j = j->next_content)
        if (j->item_number==NOTHING) {
            if(strcmp(j->short_description,i->short_description)==0) break;
        else if (j->item_number==i->item_number) break;
      if (j!=i) continue;
      for (j = i; j; j = j->next_content)
        if (j->item_number==NOTHING) {
            if(strcmp(j->short_description,i->short_description)==0) num++;
        else if (j->item_number==i->item_number) num++;

      if (CAN_SEE_OBJ(ch, i)) {
          if (num!=1) {
                sprintf(buf,"(%2i) ",num);
          show_obj_to_char(i, ch, mode);
          found = TRUE;
  if (!found && show)
    send_to_char(" Nothing.\r\n", ch);

  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST