--- deliantra/server/common/treasure.C 2006/12/12 22:37:05 1.25 +++ deliantra/server/common/treasure.C 2006/12/14 00:08:52 1.26 @@ -260,7 +260,7 @@ if (!name_) return 0; - for (treasurelist * tl = first_treasurelist; tl != 0; tl = tl->next) + for (treasurelist *tl = first_treasurelist; tl != 0; tl = tl->next) if (name_ == tl->name) return tl; @@ -341,7 +341,11 @@ if (t->name) { if (strcmp (t->name, "NONE") && difficulty >= t->magic) - create_treasure (find_treasurelist (t->name), op, flag, difficulty, tries); + { + treasurelist *tl = find_treasurelist (t->name); + if (tl) + create_treasure (tl, op, flag, difficulty, tries); + } } else { @@ -399,7 +403,11 @@ return; if (difficulty >= t->magic) - create_treasure (find_treasurelist (t->name), op, flag, difficulty, tries); + { + treasurelist *tl = find_treasurelist (t->name); + if (tl) + create_treasure (tl, op, flag, difficulty, tries); + } else if (t->nrof) create_one_treasure (tl, op, flag, difficulty, tries); @@ -1266,7 +1274,8 @@ fprintf (logfile, " "); fprintf (logfile, "{ (list: %s)\n", &t->name); tl = find_treasurelist (t->name); - dump_monster_treasure_rec (name, tl->items, depth + 2); + if (tl) + dump_monster_treasure_rec (name, tl->items, depth + 2); for (i = 0; i < depth; i++) fprintf (logfile, " "); fprintf (logfile, "} (end of list: %s)\n", &t->name);