Re: do_look

From: Rick Glover (magik@THEGRID.NET)
Date: 11/02/98


-----Original Message-----
From: Brandon Lees (Whitlock) <brandon@SCI.BROOKLYN.CUNY.EDU>
To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
Date: Monday, November 02, 1998 6:54 PM
Subject:  do_look


>I want 2 change do_look so that if there is more than one of an item
>it will be listed as <2x> a sword instead of being listed twice.  Any
>suggestions on how to go about doing this?


This is not my code, it's a snippet from somewhere.

Rick



From: Brian Williams <bmw@efn.org>
Subject: Object Stacking code

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);
  send_to_char(buf,ch);
     }
   show_obj_to_char(i, ch, mode);
   found = TRUE;
      }
  }
  if (!found && show)
    send_to_char(" Nothing.\r\n", ch);
}


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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