--- deliantra/server/common/object.C 2006/08/29 08:01:35 1.8 +++ deliantra/server/common/object.C 2006/08/30 06:06:26 1.9 @@ -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.9 2006/08/30 06:06:26 root Exp $"; */ /* @@ -2620,10 +2620,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 +2634,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; }