--- deliantra/server/common/treasure.C 2007/04/16 10:14:25 1.42 +++ deliantra/server/common/treasure.C 2007/04/17 10:06:32 1.46 @@ -78,8 +78,7 @@ } /* - * Searches for the given treasurelist in the globally linked list - * of treasurelists which has been built by load_treasures(). + * Searches for the given treasurelist */ treasurelist * treasurelist::find (const char *name) @@ -87,7 +86,7 @@ if (!name) return 0; - AUTODECL (i, tl_map.find (name)); + auto (i, tl_map.find (name)); if (i == tl_map.end ()) return 0; @@ -127,6 +126,8 @@ free_treasurestruct (tl->items); tl->items = 0; } + + tl->total_chance = 0; } /* @@ -143,7 +144,7 @@ for (;;) { - coroapi::cede_every (10); + coroapi::cede_to_tick_every (10); f.next (); @@ -207,14 +208,11 @@ * Each treasure is parsed with the help of load_treasure(). */ bool -load_treasures () +load_treasure_file (const char *filename) { treasure *t; int comp, line = 0; - char filename[MAX_BUF]; - sprintf (filename, "%s/%s", settings.datadir, settings.treasures); - object_thawer f (filename); if (!f)