--- deliantra/server/common/object.C 2006/08/29 08:01:35 1.8 +++ deliantra/server/common/object.C 2006/08/31 17:54:14 1.10 @@ -1,6 +1,6 @@ /* * static char *rcsid_object_c = - * "$Id: object.C,v 1.8 2006/08/29 08:01:35 root Exp $"; + * "$Id: object.C,v 1.10 2006/08/31 17:54:14 root Exp $"; */ /* @@ -283,6 +283,10 @@ */ void dump_object2(object *op) { +errmsg[0] = 0; +return; + //TODO//D#d# +#if 0 char *cp; /* object *tmp;*/ @@ -317,6 +321,7 @@ #endif strcat(errmsg,"end\n"); } +#endif } /* @@ -332,46 +337,6 @@ dump_object2(op); } -/* GROS - Dumps an object. Return the result into a string */ -/* Note that no checking is done for the validity of the target string, so */ -/* you need to be sure that you allocated enough space for it. */ -void dump_me(object *op, char *outstr) -{ - char *cp; - - if(op==NULL) - { - strcpy(outstr,"[NULL pointer]"); - return; - } - outstr[0]='\0'; - - if(op->arch!=NULL) - { - strcat(outstr,"arch "); - strcat(outstr,op->arch->name?op->arch->name:"(null)"); - strcat(outstr,"\n"); - if((cp=get_ob_diff(op,&empty_archetype->clone))!=NULL) - strcat(outstr,cp); - strcat(outstr,"end\n"); - } - else - { - strcat(outstr,"Object "); - if (op->name==NULL) - strcat(outstr, "(null)"); - else - strcat(outstr,op->name); - strcat(outstr,"\n"); - strcat(outstr,"end\n"); - } -} - -/* - * This is really verbose...Can be triggered by the P key while in DM mode. - * All objects are dumped to stderr (or alternate logfile, if in server-mode) - */ - void dump_all_objects(void) { object *op; for(op=objects;op!=NULL;op=op->next) { @@ -2620,10 +2585,10 @@ object* load_object_str(const char *obstr) { object *op; - FILE *tempfile; char filename[MAX_BUF]; sprintf(filename,"%s/cfloadobstr2044",settings.tmpdir); - tempfile=fopen(filename,"w"); + + FILE *tempfile=fopen(filename,"w"); if (tempfile == NULL) { LOG(llevError,"Error - Unable to access load object temp file\n"); @@ -2634,17 +2599,12 @@ op=get_object(); - tempfile=fopen(filename,"r"); - if (tempfile == NULL) - { - LOG(llevError,"Error - Unable to read object temp file\n"); - return NULL; - }; - object_thawer thawer (tempfile); - load_object(thawer,op,LO_NEWFILE,0); + object_thawer thawer (filename); + if (thawer) + load_object(thawer,op,LO_NEWFILE,0); LOG(llevDebug," load str completed, object=%s\n",op->name); CLEAR_FLAG(op,FLAG_REMOVED); - fclose(tempfile); + return op; }