No resets in the room. And it only seems to happen when there is more than one "saving" item in the room.

The thing that makes it really bad, is they tend to start growing exponentially as you hotboot.. so after it has duplicated once, to a total of 2, it will duplicate to a total of 4, then 8, etc.. after 10 hotboots (say for debugging purposes), you have around 1024 of them!! ouch!

- Valnir

----- Original Message ----- From: "Krayzie K" <[EMAIL PROTECTED]>
To: "'Valnir'" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Wednesday, November 17, 2004 10:09 AM
Subject: RE: Saving Objects.


Are all of them duplicating or just one?

And are there any resets set in the room?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Valnir
Sent: Tuesday, November 16, 2004 3:00 PM
To: [email protected]
Subject: Saving Objects.

Ok, again.. I asked this a few days ago.

Does anyone have any idea why my saving objects would be duplicating. I
posted the saving code and never got any responses.

What looks like is happening is that it's not properly moving to the next
obj while running through the list. Thoughts??

It is definitely in the SAVE part, not the load part.

Here is the save part again, let me know what any of you think. Thanks!

void save_pit ( void )
{
   OBJ_DATA *obj, *obj_next;
   FILE *fp;
   char buf[MSL];

   sprintf( buf, "%sobjects.dat", DATA_DIR );

   if ( !( fp = fopen( buf, "w+" ) ) )
   {
       bug( "Save objects: fopen", 0 );
       return;
   }

   for ( obj = object_list; obj != NULL; obj = obj_next )
   {
       obj_next = obj->next;

       if ( obj->carried_by != NULL || obj->pIndexData->delete )
           continue;

       if ( obj->item_type == ITEM_CORPSE_PC
       || obj->pIndexData->vnum == OBJ_VNUM_PIT
       || IS_OBJ_STAT(obj, ITEM_SAVE) )
           fwrite_obj( NULL, obj, fp, 0 );
   }

   fprintf( fp, "#END\n" );
   fclose( fp );
   return;
}


- Valnir

--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom



Reply via email to