Re: pfile problem w/autoquest (PLUS LOGO CONTEST)

From: Tony Robbins (tonyr@circlemud.org)
Date: 04/25/00


On Tue, 25 Apr 2000, Nate Winters wrote:

> Under bpl16 I added the autoquest code (by Vassago) from:
> http://developer.circlemud.org/1998/08/12/2334233.shtml
>
[snip]
> struct player_special_data_saved {

>    byte skills[MAX_SKILLS+1];/* array of skills plus skill 0 */
>    byte PADDING0;  /* used to be spells_to_learn */
>    bool talks[MAX_TONGUE]; /* PC s Tongues 0 for NPC */
>    int wimp_level; /* Below this # of hit points, flee! */
>    byte freeze_level; /* Level of god who froze char, if any */
>    sh_int invis_level;  /* level of invisibility */
>    room_vnum load_room;  /* Which room to place char in */
>    long /*bitvector_t*/ pref; /* preference flags for PC's. */
>    ubyte bad_pws; /* number of bad password attemps */
>    sbyte conditions[3];         /* Drunk, full, thirsty         */
>
> struct char_data *questgiver;/*<--evil line causing pfile problem**********/
>
> /* spares below for future expansion.  You can change the names
> from 'sparen' to something meaningful, but don't change the order.  */
>
>    ubyte clan_rank;
>    ubyte spare1;
>    ubyte spare2;
[snip]

Your evil line causing a pfile problem is because you're storing a
pointer.  In other words, you're storing a memory location in the binary
player file, and then when the MUD reboots (or a player leaves and
re-enters), expecting that information to be in the same place in memory
when it most likely won't.

You need to store some kind of specific information about the questgiver
that can identify that person, and then just set up a pointer in
player_specials and not player_specials.saved that will reference the
questgiver.

Otherwise, it will continue not to work.

-k.

P.S.:  I want to end the logo contest so I can work on the web pages.  We
have tallied votes here, but people might want to make last minute
changes.  Well, it's the last minute, I was supposed to end it Friday but
I'm declaring a winner tomorrow evening, approximately 5:00 PM PDT,
should all go well.


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT