Difference for server/shop.c from version 1.17 to 1.18


version 1.17 version 1.18
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_shop_c =   * static char *rcsid_shop_c =
  *   "$Id: shop.c,v 1.17 2003/01/08 08:39:20 mwedel Exp $";   *   "$Id: shop.c,v 1.18 2003/01/09 20:22:11 garbled Exp $";
  */   */
   
 /*  /*
Line 659
 
Line 659
 void shop_listing(object *op)  void shop_listing(object *op)
 {  {
     int i,j,numitems=0,numallocated=0;      int i,j,numitems=0,numallocated=0;
     char *map_mark = (char *) malloc(MAP_SIZE(op->map));  
     object *stack;      object *stack;
     shopinv *items;      shopinv *items;
   
Line 668
 
Line 667
   
     new_draw_info(NDI_UNIQUE, 0, op, "\nThe shop contains:");      new_draw_info(NDI_UNIQUE, 0, op, "\nThe shop contains:");
   
     memset(map_mark, 0, MAP_SIZE(op->map));  
     magic_mapping_mark(op, map_mark, 3);  
     items=malloc(40*sizeof(shopinv));      items=malloc(40*sizeof(shopinv));
     numallocated=40;      numallocated=40;
   
     /* Find all the appropriate items */      /* Find all the appropriate items */
     for (i=0; i<MAP_WIDTH(op->map); i++) {      for (i=0; i<MAP_WIDTH(op->map); i++) {
  for (j=0; j<MAP_HEIGHT(op->map); j++) {   for (j=0; j<MAP_HEIGHT(op->map); j++) {
      if (map_mark[i + MAP_WIDTH(op->map) * j]) {  
  stack  =get_map_ob(op->map,i,j);   stack  =get_map_ob(op->map,i,j);
   
  while (stack) {   while (stack) {
      if (QUERY_FLAG(stack, FLAG_UNPAID)) {       if (QUERY_FLAG(stack, FLAG_UNPAID)) {
  if (numitems==numallocated) {   if (numitems==numallocated) {
Line 691
 
Line 686
  }   }
      }       }
  }   }
     }  
     free(map_mark);  
     if (numitems == 0) {      if (numitems == 0) {
  new_draw_info(NDI_UNIQUE, 0, op, "The shop is currently empty.\n");   new_draw_info(NDI_UNIQUE, 0, op, "The shop is currently empty.\n");
  free(items);   free(items);


Legend:
line(s) removed in v.1.17 
line(s) changed
 line(s) added in v.1.18

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:44