Mailing List
Home
Forum Home
Mac Game - Mac game development
Rivers of MUD - a Diku and Merc based multiuser dungeon
SMAUG
Subjects
Getting UDP through NAT/firewalls/whatever for a game
Getting UDP through NAT/firewalls/whatever for a game
QuickTime errors
Python script as stand alone MUD server
Various sound problems
Fragment Shaders & GL TEXTURE RECTANGLE EXT
Timers and global variables
Re: Language and platform for Text MUD server
Apparent acquisition of Yantis (mysupersales) by IDE
HID keyboard
Getting UDP through NAT/firewalls/whatever for a game
Microsoft Sparkle
Director MX
Congratulations Horizons
Yet more problems fullscreen mode
Apple Dev Kitchen Them 's tasty vittles, Maw!
NSOpenGLContext, Pbuffers, and drawables
More DCR "theft " naughtiness
dynamic sprite creation and imaging lingo
Re: Find stuff in Flash array?
Effects of skill imbalances?
QuickTime errors
Rom 2 4/Quickmud Enhancement/Bug fix
Working with XML files/CFURL
smooth scrolling/subpixel tweening
RE: (Ron help me?) Flash text
Flash Racing
MudDev FAQ 2
Browser based games
Installing GLUT
Special character in Flash XML
 
Saving Objects.

Saving Objects.

2004-11-16       - By Valnir

 Back
Reply:     1     2     3     4     5     6  

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
ROM@(protected)
http://www.rom.org/cgi-bin/mailman/listinfo/rom