I'm trying to add object saving over copyovers to my mud and having a bit of 
trouble.   If the corpse is in a room that has resets in it (ie.. donation 
pits), the corpse saves but when it reloads I get multiple pits/fountains 
etc...

I'm using Davion's corpse saving snippet.  The section of code that checks 
for resets is below.  Can someone tell me if this looks accurate.  I can post 
more of the code if need be.

Thanks for your help.

-Mike

fpObj = fopen("../area/objcopy.txt", "w" );
for ( obj = object_list; obj != NULL; obj = obj->next )
{   has_reset = FALSE;
  if(obj->carried_by )
        continue;

  if(obj->item_type != ITEM_CORPSE_PC )
        continue;

for ( pReset = obj->in_room->reset_first; pReset; pReset = pReset->next )
                {   if(( (pReset->command == 'O' || pReset->command== 'P') 
&& pReset->arg3 == obj->pIndexData->vnum ) ||
( pReset->command == 'E' && pReset->arg1 == obj->pIndexData->vnum ) )
                        {       has_reset = TRUE;
                                break;
                        }
                }
                if(has_reset)
                        continue;
                fwrite_obj(NULL, obj, fpObj, 0 );
        }
        fprintf(fpObj, "#END\n");
        fclose(fpObj);
> No one has any idea at all?
> 
> 
> ----- Original Message ----- 
> From: "Chris "Winston" Litchfield" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Saturday, September 06, 2003 5:22 PM
> Subject: Hashing function bug. In depth.
> 
> 
> > I have been experiencing a crash for the last year or so.  This crash
> > happens as frequently as 2 times a day, and as infrequently as once a
> month.
> > This crash happens only when someone is load_char_obj().
> >
> > The following is a more detailed information
> >
> > the crash occurs in fread_string and/or stread_string.  (stread_string
> being
> > the later code I placed in after a ROM discussion a couple months back or
> > so).  It happens at this assignment:
> >
> > u1.rgc[ic] = pHash[ic];  (db.c, fread_string or stread_string)
> >
> > Totally out of bounds memory.  Some further information for those who know
> > the area of code.  IT ALWAYS happens when iHash == 44.
> >
> > What I think could be happening is that something has broken the 4 byte
> > memory boundry that the routine searches to find specific strings to match
> > the incomming string.  It is RANDOM in that I cannot seem to reproduce it
> at
> > will, and yet all the core files have this as the crash.
> >
> > I believe the crash corrupts the memory as I placed several local debug
> > variables around the code to trace how many times it looped, and those
> > values inside the debugger are "unknown variables".  They have been
> whacked.
> >
> > Has anyone experienced this?  Has anyone got suggestions on how to track
> > this down?  It is a low frequency occurance but it is the ONLY crash bug I
> > have had in last 3 months (Stability is a goal).
> >
> > Chris "Winston" Litchfield
> >
> >
> >
> > -- 
> > ROM mailing list
> > [email protected]
> > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> >
> >
> 
> 
> 
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to