Difference for random_maps/treasure.c from version 1.24 to 1.25


version 1.24 version 1.25
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_treasure_c =   * static char *rcsid_treasure_c =
  *   "$Id: treasure.c,v 1.24 2006/01/08 23:12:26 qal21 Exp $";   *   "$Id: treasure.c,v 1.25 2006/03/04 17:37:19 akirschbaum Exp $";
  */   */
   
 /*  /*
Line 257
 
Line 257
     lx=x+freearr_x[i];      lx=x+freearr_x[i];
     ly=y+freearr_y[i];      ly=y+freearr_y[i];
     /* boundscheck */      /* boundscheck */
     if(lx > 0 && ly > 0 && lx < RP->Xsize && ly < RP->Ysize)      if(lx >= 0 && ly >= 0 && lx < RP->Xsize && ly < RP->Ysize)
       /* don't bother searching this square unless the map says life exists.*/        /* don't bother searching this square unless the map says life exists.*/
       if(GET_MAP_FLAGS(map,lx,ly) & P_IS_ALIVE) {        if(GET_MAP_FLAGS(map,lx,ly) & P_IS_ALIVE) {
         object *the_monster=get_map_ob(map,lx,ly);          object *the_monster=get_map_ob(map,lx,ly);
Line 504
 
Line 504
   int i;    int i;
   x = *cx;y=*cy;    x = *cx;y=*cy;
   
   for(i=0;i<SIZEOFFREE;i++) {    for(i=0;i<=SIZEOFFREE1;i++) {
     int lx,ly,sindex;      int lx,ly,sindex;
     lx = x +freearr_x[i];      lx = x +freearr_x[i];
     ly = y +freearr_y[i];      ly = y +freearr_y[i];
Line 518
 
Line 518
   
   /* OK, if we got here, we're obviously someplace where there's no enclosed    /* OK, if we got here, we're obviously someplace where there's no enclosed
      spots--try to find someplace which is 2x enclosed.  */       spots--try to find someplace which is 2x enclosed.  */
   for(i=0;i<SIZEOFFREE;i++) {    for(i=0;i<=SIZEOFFREE1;i++) {
     int lx,ly,sindex;      int lx,ly,sindex;
     lx = x +freearr_x[i];      lx = x +freearr_x[i];
     ly = y +freearr_y[i];      ly = y +freearr_y[i];
Line 531
 
Line 531
   }    }
   
   /* settle for one surround point */    /* settle for one surround point */
   for(i=0;i<SIZEOFFREE;i++) {    for(i=0;i<=SIZEOFFREE1;i++) {
     int lx,ly,sindex;      int lx,ly,sindex;
     lx = x +freearr_x[i];      lx = x +freearr_x[i];
     ly = y +freearr_y[i];      ly = y +freearr_y[i];
Line 544
 
Line 544
   }    }
   /* give up and return the closest free spot. */    /* give up and return the closest free spot. */
   i = find_first_free_spot(&find_archetype("chest")->clone,map,x,y);    i = find_first_free_spot(&find_archetype("chest")->clone,map,x,y);
   if(i!=-1&&i<SIZEOFFREE) {    if(i!=-1&&i<=SIZEOFFREE1) {
     *cx = x +freearr_x[i];      *cx = x +freearr_x[i];
     *cy = y +freearr_y[i];      *cy = y +freearr_y[i];
       return;
   }    }
   /* indicate failure */    /* indicate failure */
   *cx=*cy=-1;    *cx=*cy=-1;


Legend:
line(s) removed in v.1.24 
line(s) changed
 line(s) added in v.1.25

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