version 1.63 | | version 1.64 |
---|
| | |
/* | | /* |
* 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 $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
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. |
| | |
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)); |
| | |
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); |
| | |
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; |
| | |
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 |