Difference for common/object.c from version 1.63 to 1.64


version 1.63 version 1.64
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_object_c =   * static char *rcsid_object_c =
  *   "$Id: object.c,v 1.63 2003/01/21 08:10:05 mwedel Exp $";   *   "$Id: object.c,v 1.64 2003/01/30 00:07:08 garbled Exp $";
  */   */
   
 /*  /*
Line 530
 
Line 530
  free_string(op->slaying);   free_string(op->slaying);
     if(op->msg!=NULL)      if(op->msg!=NULL)
  free_string(op->msg);   free_string(op->msg);
       if (op->materialname != NULL)
    free_string(op->materialname);
   
     /* Using this memset is a lot easier (and probably faster)      /* Using this memset is a lot easier (and probably faster)
      * than explicitly clearing the fields.       * than explicitly clearing the fields.
Line 583
 
Line 585
     free_string(op->slaying);      free_string(op->slaying);
   if(op->msg!=NULL)    if(op->msg!=NULL)
     free_string(op->msg);      free_string(op->msg);
     if (op->materialname != NULL)
         free_string(op->materialname);
   (void) memcpy((void *)((char *) op +offsetof(object,name)),    (void) memcpy((void *)((char *) op +offsetof(object,name)),
                 (void *)((char *) op2+offsetof(object,name)),                  (void *)((char *) op2+offsetof(object,name)),
                 sizeof(object)-offsetof(object, name));                  sizeof(object)-offsetof(object, name));
Line 602
 
Line 606
     add_refcount(op->slaying);      add_refcount(op->slaying);
   if(op->msg!=NULL)    if(op->msg!=NULL)
     add_refcount(op->msg);      add_refcount(op->msg);
     if (op->materialname != NULL)
         add_refcount(op->materialname);
   if((op2->speed<0) && !editor)    if((op2->speed<0) && !editor)
     op->speed_left=op2->speed_left-RANDOM()%200/100.0;      op->speed_left=op2->speed_left-RANDOM()%200/100.0;
   update_ob_speed(op);    update_ob_speed(op);
Line 676
 
Line 682
   op->race=NULL;    op->race=NULL;
   op->slaying=NULL;    op->slaying=NULL;
   op->msg=NULL;    op->msg=NULL;
     op->materialname=NULL;
   op->next=objects;    op->next=objects;
   op->prev=NULL;    op->prev=NULL;
   op->active_next = NULL;    op->active_next = NULL;
Line 974
 
Line 981
     if(ob->race!=NULL) FREE_AND_CLEAR_STR(ob->race);      if(ob->race!=NULL) FREE_AND_CLEAR_STR(ob->race);
     if(ob->slaying!=NULL) FREE_AND_CLEAR_STR(ob->slaying);      if(ob->slaying!=NULL) FREE_AND_CLEAR_STR(ob->slaying);
     if(ob->msg!=NULL) FREE_AND_CLEAR_STR(ob->msg);      if(ob->msg!=NULL) FREE_AND_CLEAR_STR(ob->msg);
       if(ob->materialname!=NULL) FREE_AND_CLEAR_STR(ob->materialname);
   
 #if 0 /* MEMORY_DEBUG*/  #if 0 /* MEMORY_DEBUG*/
     /* This is a nice idea.  Unfortunately, a lot of the code in crossfire      /* This is a nice idea.  Unfortunately, a lot of the code in crossfire


Legend:
line(s) removed in v.1.63 
line(s) changed
 line(s) added in v.1.64

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