Re: DG regen problem

From: Doppleganger Software (doppsoft@TZC.COM)
Date: 07/24/98


>ok, here's the problem i'm having...
>after i added DG events, and DG regen, after someone reconnects(or
>sometimes just connects) it will try to access a structure with a bunch of
>out of bound variables.
>Has anybody else had this problem before ?
>Any help would be appreciated.

Oh yes, this is one bug that I found too.  Eric got a fix out to me, but
there was never an update to the official release.  Here is what you do:

in regen.c, in all the alter_stat functions, right after a line that
should look like this:

  GET_MOVE(ch) = MIN(GET_MOVE(ch) - amount, GET_MAX_MOVE(ch));

(it'll be different for every function) add these lines:

  if (ch->in_room == NOWHERE)
    return;

Also, add them to the very beginning of check_regen_rates.

This happened to me a lot when people logged off.  The problem was,
check_regen_rates is called in affect_total, which is called AFTER the
player has left the game.  With this, it creates an event, after the old
ones are freed, and then the character is gone, leaving a pointer to
freed memory.  It's a real pain in da butt.

---
"One hundred years from now, none of this will matter because you and I
will be dead -- unless the Grim Reaper has switched his record-keeping to
a Windows 95-based system, in which case we all might live forever. "
-- Associated Press


     +------------------------------------------------------------+
     | 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/15/00 PST