version 1.68 | | version 1.69 |
---|
| | |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: object.c,v 1.68 2003/04/05 05:39:48 mwedel Exp $"; | | * "$Id: object.c,v 1.69 2003/06/26 11:27:43 gros Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
*/ | | */ |
| | |
void reset_object(object *op) { | | void reset_object(object *op) { |
int i; | | |
| | |
op->name = NULL; | | op->name = NULL; |
op->name_pl = NULL; | | op->name_pl = NULL; |
| | |
op->msg = NULL; | | op->msg = NULL; |
op->materialname = NULL; | | op->materialname = NULL; |
op->lore = NULL; | | op->lore = NULL; |
for(i=0;i<30;i++) { | | |
op->event_hook[i] = NULL; | | |
op->event_plugin[i] = NULL; | | |
op->event_options[i] = NULL; | | |
} | | |
op->current_weapon_script = NULL; | | op->current_weapon_script = NULL; |
clear_object(op); | | clear_object(op); |
} | | } |
| | |
| | |
void clear_object(object *op) { | | void clear_object(object *op) { |
| | |
| | event *evt; |
| | event *evt2; |
| | |
/* 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. |
*/ | | */ |
| | |
op->attacked_by_count= -1; | | op->attacked_by_count= -1; |
if (settings.casting_time == TRUE) | | if (settings.casting_time == TRUE) |
op->casting = -1; | | op->casting = -1; |
| | /* Clean the events list */ |
| | while (op->events != NULL) |
| | { |
| | evt2 = NULL; |
| | evt = op->events; |
| | while (evt->next != NULL) |
| | { |
| | evt2 = evt; |
| | evt = evt->next; |
| | |
| | } |
| | |
| | if (evt->hook != NULL) FREE_AND_CLEAR(evt->hook); |
| | if (evt->plugin != NULL) FREE_AND_CLEAR(evt->plugin); |
| | if (evt->options != NULL) FREE_AND_CLEAR(evt->options); |
| | |
| | FREE_AND_CLEAR(evt); |
| | |
| | if (evt2 != NULL) |
| | evt2->next = NULL; |
| | else |
| | op->events = NULL; |
| | } |
| | |
} | | } |
| | |
/* | | /* |