--- deliantra/server/common/treasure.C 2006/08/27 16:15:11 1.2 +++ deliantra/server/common/treasure.C 2006/08/28 14:05:24 1.3 @@ -1,7 +1,7 @@ /* * static char *rcs_treasure_c = - * "$Id: treasure.C,v 1.2 2006/08/27 16:15:11 root Exp $"; + * "$Id: treasure.C,v 1.3 2006/08/28 14:05:24 root Exp $"; */ /* @@ -1272,25 +1272,25 @@ void init_artifacts(void) { static int has_been_inited=0; - FILE *fp; + FILE *fp_; char filename[MAX_BUF], buf[HUGE_BUF], *cp, *next; artifact *art=NULL; linked_char *tmp; int value, comp; artifactlist *al; - object_thawer thawer; - if (has_been_inited) return; else has_been_inited = 1; sprintf(filename, "%s/artifacts", settings.datadir); LOG(llevDebug, "Reading artifacts from %s...",filename); - if ((fp = open_and_uncompress(filename, 0, &comp)) == NULL) { + if ((fp_ = open_and_uncompress(filename, 0, &comp)) == NULL) { LOG(llevError, "Can't open %s.\n", filename); return; } + object_thawer fp (fp_); + while (fgets(buf, HUGE_BUF, fp)!=NULL) { if (*buf=='#') continue; if((cp=strchr(buf,'\n'))!=NULL) @@ -1325,7 +1325,7 @@ else if (!strncmp(cp, "Object",6)) { art->item = (object *) calloc(1, sizeof(object)); reset_object(art->item); - if (!load_object(fp, thawer, art->item,LO_LINEMODE,0)) + if (!load_object(fp, art->item,LO_LINEMODE,0)) LOG(llevError,"Init_Artifacts: Could not load object.\n"); art->item->name = add_string((strchr(cp, ' ')+1)); al=find_artifactlist(art->item->type);