--- deliantra/server/common/treasure.C 2006/09/03 08:05:39 1.8 +++ deliantra/server/common/treasure.C 2006/09/04 11:07:59 1.11 @@ -1,7 +1,7 @@ /* * static char *rcs_treasure_c = - * "$Id: treasure.C,v 1.8 2006/09/03 08:05:39 root Exp $"; + * "$Id: treasure.C,v 1.11 2006/09/04 11:07:59 root Exp $"; */ /* @@ -123,7 +123,7 @@ LOG (llevError, "Treasure lacks archetype: %s\n", variable); } else if (sscanf (cp, "list %s", variable)) - t->name = variable; + t->name = variable; else if (sscanf (cp, "change_name %s", variable)) t->change_arch.name = variable; else if (sscanf (cp, "change_title %s", variable)) @@ -270,10 +270,14 @@ if (tmp != NULL) for (tl = first_treasurelist; tl != NULL; tl = tl->next) - if (tmp == tl->name) - return tl; + { + if (tmp == tl->name) + return tl; + } + + if (first_treasurelist) + LOG (llevError, "Couldn't find treasurelist %s(%s)\n", name, tmp); - LOG (llevError, "Couldn't find treasurelist %s\n", name); return NULL; } @@ -1373,10 +1377,11 @@ art->difficulty = (uint8) value; else if (!strncmp (cp, "Object", 6)) { - art->item = (object *) calloc (1, sizeof (object)); - reset_object (art->item); - if (!load_object (thawer, art->item, LO_LINEMODE, 0)) + art->item = get_object (); + + if (!load_object (thawer, art->item, 0)) LOG (llevError, "Init_Artifacts: Could not load object.\n"); + art->item->name = strchr (cp, ' ') + 1; al = find_artifactlist (art->item->type); if (al == NULL)