version 1.35 | | version 1.36 |
---|
| | |
| | |
/* | | /* |
* static char *rcs_treasure_c = | | * static char *rcs_treasure_c = |
* "$Id: treasure.c,v 1.35 2003/02/14 05:50:29 garbled Exp $"; | | * "$Id: treasure.c,v 1.36 2003/06/26 11:27:43 gros Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/* GROS: Added support for event_... in artifact file */ | | /* GROS: Added support for event_... in artifact file */ |
for(j=0;j<20;j++) | | for(j=0;j<20;j++) |
{ | | { |
if(change->event_hook[j]) | | event *evt; |
| | event *evt2; |
| | event *evtn; |
| | event *evtp; |
| | |
| | evt = find_event(change,j); |
| | evt2= find_event(op,j); |
| | |
| | if ((evt) && (evt->hook)) |
{ | | { |
if (op->event_hook[j]) | | if ((evt2)&&(evt2->hook)) |
{ | | { |
free_string(op->event_hook[j]); | | free_string(evt2->hook); |
free_string(op->event_plugin[j]); | | free_string(evt2->plugin); |
free_string(op->event_options[j]); | | free_string(evt2->options); |
}; | | evtp = NULL; |
op->event_hook[j] = add_refcount(change->event_hook[j]); | | evtn = evt2->next; |
op->event_plugin[j] = add_refcount(change->event_plugin[j]); | | if (evt2 == op->events) |
if (change->event_options[j]) | | { |
op->event_options[j] = add_refcount(change->event_options[j]); | | free(evt2); |
| | op->events = evtn; |
| | } |
| | else |
| | { |
| | evtp = op->events; |
| | while (evtp->next != evt2) |
| | evtp = evtp->next; |
| | free(evt2); |
| | evtp->next = evtn; |
| | } |
| | } |
| | |
| | evt2->hook = add_refcount(evt->hook); |
| | evt2->plugin = add_refcount(evt->plugin); |
| | |
| | if (evt->options) |
| | evt2->options = add_refcount(evt->options); |
| | } |
} | | } |
}; | | |
} | | } |
| | |
static int legal_artifact_combination(object *op, artifact *art) { | | static int legal_artifact_combination(object *op, artifact *art) { |