> My saving problem previously was kind of weird (aren't they all).  My imm
> would never save.  He'd still be a lvl 60 imm, but nothing I did would
save.
> And my characters wouldn't save often at all.   Like I took a mortal from
1
> to 3, after attaining 3, I quit, relogged on, he was at 2.  This added
> statement corrected that.
> > > The only mod I made to this code (aside from adjusting some output in
> > > healer.c) was in save.c.  I added
> > > remove (strsave); before the rename(TEMP_FILE, strsave); statement.


WRONG, i say again WRONG not good at all...

*nix based operating systems have a different definition for rename than
windows ones do... in *nix it will work everytime/ all the time.
in windows if the file being named to (the target) exists it errors out.

-solution-


at top of save.c (or any .h file for that matter that gets called when in
save.c):
#if defined(WIN32)
#define rename(origname, newname) systemf("move /y %s %s", (origname),
(newname))
#endif


systemf is a little function that is used like sprintf to send commands to
the system.
throw the following in with the other function proto's

int systemf args( ( char * fmt, ...) );

then add this to comm.c with things like send_to_char

int systemf( char * fmt, ...)
{
 char buf[4*MSL];
 va_list args;
 va_start (args, fmt);
 vsprintf(buf, fmt, args);
 va_end(args);
 return system(buf);
}


The above method make the original code (sans remove(blat)) work everytime
in windows, just like in *nix.

Have fun

Steve (recovering from a system rebuild)



Reply via email to