Difference for common/object.c from version 1.59 to 1.60


version 1.59 version 1.60
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_object_c =   * static char *rcsid_object_c =
  *   "$Id: object.c,v 1.59 2002/11/13 00:49:46 garbled Exp $";   *   "$Id: object.c,v 1.60 2002/12/01 03:46:25 mwedel Exp $";
  */   */
   
 /*  /*
Line 1362
 
Line 1362
     if (!QUERY_FLAG(op, FLAG_ALIVE))      if (!QUERY_FLAG(op, FLAG_ALIVE))
  CLEAR_FLAG(op, FLAG_NO_STEAL);   CLEAR_FLAG(op, FLAG_NO_STEAL);
   
       if (flag & INS_BELOW_ORIGINATOR) {
    if (originator->map != op->map || originator->x != op->x ||
        originator->y != op->y) {
        LOG(llevError,"insert_ob_in_map called with INS_BELOW_ORIGINATOR when originator not on same space!\n");
        abort();
    }
    op->above = originator;
    op->below = originator->below;
    if (op->below) op->below->above = op;
    else SET_MAP_OB(op->map, op->x, op->y, op);
    originator->below = op;
       } else {
     /* If there are other objects, then */      /* If there are other objects, then */
     if((top=GET_MAP_OB(op->map,op->x,op->y))!=NULL) {      if((top=GET_MAP_OB(op->map,op->x,op->y))!=NULL) {
  object *last=NULL;   object *last=NULL;
Line 1369
 
Line 1381
  * If there are multiple objects on this space, we do some trickier handling.   * If there are multiple objects on this space, we do some trickier handling.
  * We've already dealt with merging if appropriate.   * We've already dealt with merging if appropriate.
  * Generally, we want to put the new object on top. But if   * Generally, we want to put the new object on top. But if
  * flag contains INS_ABOVE_FLOOR_ONLY, once we find the lastt        * flag contains INS_ABOVE_FLOOR_ONLY, once we find the last
  * floor, we want to insert above that and no further.   * floor, we want to insert above that and no further.
  * Also, if there are spell objects on this space, we stop processing   * Also, if there are spell objects on this space, we stop processing
  * once we get to them.  This reduces the need to traverse over all of    * once we get to them.  This reduces the need to traverse over all of
Line 1397
 
Line 1409
  */   */
   
         /* Have object 'fall below' other objects that block view.          /* Have object 'fall below' other objects that block view.
  * We take simple approach - instead of dumping it below the object that  
  * blocks the view, we just dump it right above the floor.  Saves   
  * us the effort of trying to find the object that blocks the view.  
  * If INS_ON_TOP is used, don't do this processing   * If INS_ON_TOP is used, don't do this processing
         * Need to find the object that in fact blocks view, otherwise
         * stacking is a bit odd.
          */           */
         if (!(flag & INS_ON_TOP) && blocks_view(op->map, op->x, op->y) &&           if (!(flag & INS_ON_TOP) && blocks_view(op->map, op->x, op->y) &&
     (op->face && !op->face->visibility)) {      (op->face && !op->face->visibility)) {
      top = floor;   for (last=top; last != floor; last=last->below)
        if QUERY_FLAG(last, FLAG_BLOCKSVIEW) break;
    /* Check to see i we found the object that blocks view,
    * and make sure we have a below pointer for it so that
    * we can get inserted below this one, which requires we
    * set top to the object below us.
    */
    if (last && last->below && last != floor) top=last->below;
  }   }
     } /* If objects on this space */      } /* If objects on this space */
   
Line 1425
 
Line 1443
  op->below = top;   op->below = top;
  top->above = op;   top->above = op;
     }      }
       } /* else not INS_BELOW_ORIGINATOR */
   
     if(op->type==PLAYER)      if(op->type==PLAYER)
  op->contr->do_los=1;   op->contr->do_los=1;
   
     /* If we have a floor, we know the player, if any, will be above      /* If we have a floor, we know the player, if any, will be above
      * it, so save a few ticks and start from there.       * it, so save a few ticks and start from there.
      */       */


Legend:
line(s) removed in v.1.59 
line(s) changed
 line(s) added in v.1.60

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