Re: [CODE][HELP] Portal Spell crashes when portal fades

From: Doppleganger Software (doppsoft@TZC.COM)
Date: 03/20/98

>As I mentioned before, all works well with the spell initially.  It's just
>the tick after that makes everything go BOOM...

Well, first off, I think that this version of the portal spell is buggier
than a downtown New York appartment.  ;)  Firstly, let's look at the
limits.c patch.

>    if (GET_OBJ_TYPE(j) == ITEM_PORTAL) {
>      if (GET_OBJ_TIMER(j) > 0)
>          GET_OBJ_TIMER(j)--;
>      if (!GET_OBJ_TIMER(j)) {
>        act("A glowing portal fades from existance.",
>             TRUE, world[j->in_room].people, j, 0, TO_ROOM);
>        act("A glowing portal fades from existance.",
>             TRUE, world[j->in_room].people, j, 0, TO_CHAR);
>        extract_obj(j);
>      }
>    }

Do you see a check to see if there is even anyone IN the room that the
portal is in?  Nope!  That's bad!  Bad programmer, bad!  No compiler!
>:)  (not you, the one who made this originally)  Put the two act's between
this if:

         if (world[j->in_room].people) {

That will make sure that if no one is there to see it, it doesn't do it.
The tree fell in this coding forest and it tried to make a sound, that's
BAD!  It was attempting to send a message to players in a room that may
not be there.  You may have been in the room of one portal, but was there
anyone in the OTHER room?  The mob you portaled to may have walked off.

>Anyone see anything wrong?

Anything else wrong...Hmmmmm...let's see.

Well, as to why it goes boom before it's time, that's something I can't
see.  Sounds like something is removing the timer before it's time.  That
would indicate that the placement of the limits.c code could be placed
wrong.  For now, do the change above, and see if it crashes.  Hopefully,
it won't.  If the portal goes poof early, then we will try and track that
down.  Let's just kill the crashing first.

"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:  |
     | |

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