Re: Ascii Pfile Fix (was Re: Weather & Zones?)

From: Davies, Nathan (DaviesN@AECL.CA)
Date: 10/23/97


Well for the most part, this worked great, so thanks alot.

The part that didn't work however was a reference to ch->desc->host
after removing the check for ch->desc.  This of course crashed the mud.
Did you happen to have another way to save the host, because when I do
the set file player options I lose the host.

Thanks,
>Nathan Davies,

>>My set file player <whatever> <value> isn't working, but I don't see
>>why...
>in do_set() :
>    CREATE(cbuf, struct char_data, 1);
>    clear_char(cbuf);
>    if ((player_i = load_char(name, &tmp_store)) > -1) {
>      store_to_char(&tmp_store, cbuf);
>      GET_PFILEPOS(cbuf) = player_i;      // NEEDED if saving to file <--
>add this line
>
>and in save_char() in db.c (not sure what the original line was)
>change the if (IS_NPC(ch)....
>              return;
>part
>to
>if (IS_NPC(ch) || GET_PFILEPOS(ch) < 0 || !ch->desc)
>    return;
>this SHOULD kick out if GET_PFILEPOS(ch) > 0  (ie you set the
>pfilepos(cbuf) -> player_i in load_char() and are trying to save
>em now.
>if it STILL doesn't save to disk after this change,
>remove the  '|| !ch->desc'  part in save_char().
>b/c it works fine with me now :-) it was a hard bug to track down.
>
>btw, i hope you guys remembered a
>fclose(fl);
>right before
>return(id);
>in load_char()
>because if you didn't, you'll have problems.
>
>>Thanks,
>You're welcome :-P
>
>Code On
>Akuma the Raging Coder
>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST