--- deliantra/server/common/arch.C 2006/08/26 08:44:04 1.2 +++ deliantra/server/common/arch.C 2006/08/29 05:03:54 1.6 @@ -1,6 +1,6 @@ /* * static char *rcsid_arch_c = - * "$Id: arch.C,v 1.2 2006/08/26 08:44:04 root Exp $"; + * "$Id: arch.C,v 1.6 2006/08/29 05:03:54 root Exp $"; */ /* @@ -31,6 +31,8 @@ #include #include +#include + /* IF set, does a little timing on the archetype load. */ #define TIME_ARCH_LOAD 0 @@ -159,26 +161,6 @@ return create_singularity(name); } - /* GROS - find_best_weapon_used_match and item_matched_string moved there */ -object *find_best_weapon_used_match(object *pl, const char *params) - { - object *tmp, *best=NULL; - int match_val=0,tmpmatch; - - for (tmp=pl->inv; tmp; tmp=tmp->below) { - if (tmp->invisible) continue; - if ((tmpmatch=item_matched_string(pl, tmp, params))>match_val) - { - if ((QUERY_FLAG(tmp, FLAG_APPLIED))&&(tmp->type==WEAPON)) - { - match_val=tmpmatch; - best=tmp; - }; - } - } - return best; - } - /* This is a subset of the parse_id command. Basically, name can be * a string seperated lists of things to match, with certain keywords. * pl is the player (only needed to set count properly) @@ -399,7 +381,7 @@ * Reads/parses the archetype-file, and copies into a linked list * of archetype-structures. */ -void first_arch_pass(FILE *fp) { +void first_arch_pass(object_thawer &fp) { object *op; archetype *at,*head=NULL,*last_more=NULL; int i,first=2; @@ -546,7 +528,10 @@ #if TIME_ARCH_LOAD GETTIMEOFDAY(&tv1); #endif - first_arch_pass(fp); + { + object_thawer thawer (fp); + first_arch_pass (thawer); + } #if TIME_ARCH_LOAD { int sec, usec; GETTIMEOFDAY(&tv2); @@ -732,6 +717,7 @@ return NULL; } copy_object(&at->clone,op); + op->instantiate (); return op; }