version 1.66 | | version 1.67 |
---|
| | |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: object.c,v 1.66 2003/02/04 04:06:13 mwedel Exp $"; | | * "$Id: object.c,v 1.67 2003/02/12 06:30:26 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
(ob1->slaying != ob2->slaying) || | | (ob1->slaying != ob2->slaying) || |
(ob1->value != ob2->value) || | | (ob1->value != ob2->value) || |
(ob1->animation_id != ob2->animation_id) || | | (ob1->animation_id != ob2->animation_id) || |
(ob1->client_type != ob2->client_type) | | (ob1->client_type != ob2->client_type) || |
| | (ob1->materialname != ob2->materialname) || |
| | (ob1->lore != ob2->lore) |
) | | ) |
return 0; | | return 0; |
| | |
| | |
| | |
void reset_object(object *op) { | | void reset_object(object *op) { |
int i; | | int i; |
| | |
op->name = NULL; | | op->name = NULL; |
op->name_pl = NULL; | | op->name_pl = NULL; |
op->title = NULL; | | op->title = NULL; |
| | |
op->slaying = NULL; | | op->slaying = NULL; |
op->msg = NULL; | | op->msg = NULL; |
op->materialname = NULL; | | op->materialname = NULL; |
for(i=0;i<30;i++) | | op->lore = NULL; |
{ | | for(i=0;i<30;i++) { |
op->event_hook[i] = NULL; | | op->event_hook[i] = NULL; |
op->event_plugin[i] = NULL; | | op->event_plugin[i] = NULL; |
op->event_options[i] = NULL; | | op->event_options[i] = NULL; |
| | |
/* the memset will clear all these values for us, but we need | | /* the memset will clear all these values for us, but we need |
* to reduce the refcount on them. | | * to reduce the refcount on them. |
*/ | | */ |
if(op->name!=NULL) | | if (op->name!=NULL) FREE_AND_CLEAR_STR(op->name); |
free_string(op->name); | | if (op->name_pl!=NULL) FREE_AND_CLEAR_STR(op->name_pl); |
if(op->name_pl!=NULL) | | if (op->title != NULL) FREE_AND_CLEAR_STR(op->title); |
free_string(op->name_pl); | | if (op->race!=NULL) FREE_AND_CLEAR_STR(op->race); |
if(op->title != NULL) | | if (op->slaying!=NULL) FREE_AND_CLEAR_STR(op->slaying); |
free_string(op->title); | | if (op->msg!=NULL) FREE_AND_CLEAR_STR(op->msg); |
if(op->race!=NULL) | | if (op->lore!=NULL) FREE_AND_CLEAR_STR(op->lore); |
free_string(op->race); | | if (op->materialname!= NULL) FREE_AND_CLEAR_STR(op->materialname); |
if(op->slaying!=NULL) | | |
free_string(op->slaying); | | |
if(op->msg!=NULL) | | |
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->race); | | free_string(op->race); |
if(op->slaying!=NULL) | | if(op->slaying!=NULL) |
free_string(op->slaying); | | free_string(op->slaying); |
| | if(op->lore!=NULL) |
| | free_string(op->lore); |
if(op->msg!=NULL) | | if(op->msg!=NULL) |
free_string(op->msg); | | free_string(op->msg); |
if (op->materialname != NULL) | | if (op->materialname != NULL) |
| | |
add_refcount(op->race); | | add_refcount(op->race); |
if(op->slaying!=NULL) | | if(op->slaying!=NULL) |
add_refcount(op->slaying); | | add_refcount(op->slaying); |
| | if(op->lore!=NULL) |
| | add_refcount(op->lore); |
if(op->msg!=NULL) | | if(op->msg!=NULL) |
add_refcount(op->msg); | | add_refcount(op->msg); |
if (op->materialname != NULL) | | if (op->materialname != NULL) |
| | |
op->title=NULL; | | op->title=NULL; |
op->race=NULL; | | op->race=NULL; |
op->slaying=NULL; | | op->slaying=NULL; |
| | op->lore=NULL; |
op->msg=NULL; | | op->msg=NULL; |
op->materialname=NULL; | | op->materialname=NULL; |
op->next=objects; | | op->next=objects; |
| | |
if(ob->title!=NULL) FREE_AND_CLEAR_STR(ob->title); | | if(ob->title!=NULL) FREE_AND_CLEAR_STR(ob->title); |
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->lore!=NULL) FREE_AND_CLEAR_STR(ob->lore); |
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(ob->materialname!=NULL) FREE_AND_CLEAR_STR(ob->materialname); |
| | |