Difference for common/object.c from version 1.131 to 1.132


version 1.131 version 1.132
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_object_c =   * static char *rcsid_object_c =
  *   "$Id: object.c,v 1.131 2006/06/07 21:44:05 tchize Exp $";   *   "$Id: object.c,v 1.132 2006/06/18 11:27:10 tchize Exp $";
  */   */
   
 /*  /*
Line 913
 
Line 913
  */   */
   
 void update_ob_speed(object *op) {  void update_ob_speed(object *op) {
     /* FIXME what the hell is this crappy hack?*/
     extern int arch_init;      extern int arch_init;
   
     /* No reason putting the archetypes objects on the speed list,      /* No reason putting the archetypes objects on the speed list,
Line 932
 
Line 933
     }      }
     if (FABS(op->speed)>MIN_ACTIVE_SPEED) {      if (FABS(op->speed)>MIN_ACTIVE_SPEED) {
  /* If already on active list, don't do anything */   /* If already on active list, don't do anything */
       /* TODO this check can probably be simplified a lot */
  if (op->active_next || op->active_prev || op==active_objects)   if (op->active_next || op->active_prev || op==active_objects)
      return;       return;
   
Line 941
 
Line 943
  if (op->active_next!=NULL)   if (op->active_next!=NULL)
  op->active_next->active_prev = op;   op->active_next->active_prev = op;
  active_objects = op;   active_objects = op;
     }    } else {
     else {  
  /* If not on the active list, nothing needs to be done */   /* If not on the active list, nothing needs to be done */
  if (!op->active_next && !op->active_prev && op!=active_objects)   if (!op->active_next && !op->active_prev && op!=active_objects)
      return;       return;
Line 951
 
Line 952
      active_objects = op->active_next;       active_objects = op->active_next;
      if (op->active_next!=NULL)       if (op->active_next!=NULL)
  op->active_next->active_prev = NULL;   op->active_next->active_prev = NULL;
  }      } else {
  else {  
      op->active_prev->active_next = op->active_next;       op->active_prev->active_next = op->active_next;
      if (op->active_next)       if (op->active_next)
  op->active_next->active_prev = op->active_prev;   op->active_next->active_prev = op->active_prev;
Line 981
 
Line 981
  active_objects = op->active_next;   active_objects = op->active_next;
  if (op->active_next!=NULL)   if (op->active_next!=NULL)
      op->active_next->active_prev = NULL;       op->active_next->active_prev = NULL;
     }    } else {
     else {  
  op->active_prev->active_next = op->active_next;   op->active_prev->active_next = op->active_next;
  if (op->active_next)   if (op->active_next)
      op->active_next->active_prev = op->active_prev;       op->active_next->active_prev = op->active_prev;
Line 1012
 
Line 1011
  *  as that is easier than trying to look at what may have changed.   *  as that is easier than trying to look at what may have changed.
  * UP_OBJ_FACE: only the objects face has changed.   * UP_OBJ_FACE: only the objects face has changed.
  */   */
   /* FIXME this function should be renames something like update_object_map, update_object is a too general term
    * Also it might be worth moving it to map.c
    */
 void update_object(object *op, int action) {  void update_object(object *op, int action) {
     int update_now=0, flags;      int update_now=0, flags;
     MoveType move_on, move_off, move_block, move_slow;      MoveType move_on, move_off, move_block, move_slow;
Line 1149
 
Line 1150
  free_object2(op, free_inventory);   free_object2(op, free_inventory);
  op=tmp;   op=tmp;
      }       }
  }      } else { /* Put objects in inventory onto this space */
  else { /* Put objects in inventory onto this space */  
      op=ob->inv;       op=ob->inv;
      while(op!=NULL) {       while(op!=NULL) {
  tmp=op->below;   tmp=op->below;
Line 1179
 
Line 1179
  objects=ob->next;   objects=ob->next;
  if(objects!=NULL)   if(objects!=NULL)
      objects->prev=NULL;       objects->prev=NULL;
     }    } else {
     else {  
  ob->prev->next=ob->next;   ob->prev->next=ob->next;
  if(ob->next!=NULL)   if(ob->next!=NULL)
      ob->next->prev=ob->prev;       ob->next->prev=ob->prev;


Legend:
line(s) removed in v.1.131 
line(s) changed
 line(s) added in v.1.132

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