Re: Stumping Bug in do_enter

From: Welcor (welcor@dune.net)
Date: 10/17/01


----- Original Message -----
From: "Ramsey Stone" <ramseystone@HOTMAIL.COM>
<snip>
>            target = GET_OBJ_VAL(obj, 0);
>        act("&nYou enter $P and fly through time and space...",
>            FALSE, ch, 0, obj, TO_CHAR);
>        act("&n$n enters $P and disappears...", FALSE, ch, 0, obj, TO_ROOM);
>        char_from_room(ch);
>        char_to_room(ch, target);
<snip>

char_to_room takes a room_rnum as second argument. Try something like this instead:

<same snip as above>
        if ((target = real_room(GET_OBJ_VAL(obj, 0))) == NOWHERE) {
          act("&nYou enter $P and come out on the other side...",
               FALSE, ch, 0, obj, TO_CHAR);
          /* Use mudlog(), if you wish */
          log("SYSERR: Portal object %d has no valid target (%d)",
               GET_OBJ_VNUM(obj), GET_OBJ_VAL(obj, 0));
          return;
        }
        act("&nYou enter $P and fly through time and space...",
            FALSE, ch, 0, obj, TO_CHAR);
        act("&n$n enters $P and disappears...", FALSE, ch, 0, obj, TO_ROOM);
        char_from_room(ch);
        char_to_room(ch, target);
<same snip as above>

The above is mailer code, but should work.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST