Difference for socket/info.c from version 1.4 to 1.5


version 1.4 version 1.5
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_sock_info_c =   * static char *rcsid_sock_info_c =
  *   "$Id: info.c,v 1.4 2001/07/14 04:12:01 mwedel Exp $";   *   "$Id: info.c,v 1.5 2001/08/08 14:40:50 avogl Exp $";
  */   */
   
 /*  /*
Line 447
 
Line 447
  LOG(llevError,"Non player objectg called draw_map.\n");   LOG(llevError,"Non player objectg called draw_map.\n");
  return;   return;
     }      }
      
     /* First, we figure out what spaces are 'reachable' by the player */      /* First, we figure out what spaces are 'reachable' by the player */
     memset(map_mark, 0, MAP_WIDTH(pl->map) * MAP_HEIGHT(pl->map));      memset(map_mark, 0, MAP_WIDTH(pl->map) * MAP_HEIGHT(pl->map));
     magic_mapping_mark(pl, map_mark, 3);      magic_mapping_mark(pl, map_mark, 3);
Line 460
 
Line 461
         }          }
       }        }
     }      }
   
     xmin--;      xmin--;
     xmin = xmin < 0 ? 0 : xmin;      xmin = xmin < 0 ? 0 : xmin;
     xmax++;      xmax++;
Line 469
 
Line 471
     ymax++;      ymax++;
     ymax = ymax > MAP_HEIGHT(pl->map) - 1? MAP_HEIGHT(pl->map) - 1: ymax;      ymax = ymax > MAP_HEIGHT(pl->map) - 1? MAP_HEIGHT(pl->map) - 1: ymax;
   
   
     sl.buf=malloc(MAXSOCKBUF);      sl.buf=malloc(MAXSOCKBUF);
     sprintf((char*)sl.buf,"magicmap %d %d %d %d ", (xmax-xmin+1), (ymax-ymin+1),      sprintf((char*)sl.buf,"magicmap %d %d %d %d ", (xmax-xmin+1), (ymax-ymin+1),
      pl->x - xmin, pl->y - ymin);       pl->x - xmin, pl->y - ymin);
Line 485
 
Line 486
      if ((mark=map_mark[x+MAP_WIDTH(pl->map)*y])==0)       if ((mark=map_mark[x+MAP_WIDTH(pl->map)*y])==0)
  sl.buf[sl.len++]=0;   sl.buf[sl.len++]=0;
      else {       else {
            /* get map face and assign the proper magicmap value */
  New_Face *f = GET_MAP_FACE(pl->map, x, y, 0);   New_Face *f = GET_MAP_FACE(pl->map, x, y, 0);
  if (mark==2)   if (f==NULL) {
        /* this map spot is completely empty */
        sl.buf[sl.len++]=0;
    }
    else if (mark==2)
      sl.buf[sl.len++]=f->magicmap | FACE_WALL;       sl.buf[sl.len++]=f->magicmap | FACE_WALL;
  else   else
      sl.buf[sl.len++]=f->magicmap;       sl.buf[sl.len++]=f->magicmap;
Line 494
 
Line 500
   
       } /* x loop */        } /* x loop */
     } /* y loop */      } /* y loop */
      
     Send_With_Handling(&pl->contr->socket, &sl);      Send_With_Handling(&pl->contr->socket, &sl);
     free(sl.buf);      free(sl.buf);
     free(map_mark);      free(map_mark);


Legend:
line(s) removed in v.1.4 
line(s) changed
 line(s) added in v.1.5

File made using version 1.98 of cvs2html by leaf at 2011-07-21 19:34