Re: Stumping Bug in do_enter

From: Matthew Grosse (grosse@elvis.rowan.edu)
Date: 10/18/01


Make sure 'target' is of the correct data type.


On Thu, 18 Oct 2001, Ramsey Stone wrote:

> Greetings CircleMUD Coders,
>
> I seem to have a dilema with my new portal code. I didnt make a spell, because
> I didnt find punching in a vnum RP like. Instead I just made an obj type and added
> value options to OLC. It uses value 0 for the target. The editing works fine, my
> problem is the entering. Whenever I type 'enter portal' the mud crashes. Here is
> my code:
>
>     if ((obj = get_obj_in_list_vis(ch, buf, NULL, world[IN_ROOM(ch)].contents))) {
>       if (CAN_SEE_OBJ(ch, obj)) {
>         if (GET_OBJ_TYPE(obj) == ITEM_PORTAL) {
>             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);
>         look_at_room(ch, FALSE);
>         act("&nSuddenly, $n steps out of a rip through time and space.",
>             FALSE, ch, 0, 0, TO_ROOM);
> }
> }
> }
>
> No errors of the sort. Its added into do_enter smack after if (*buf) {
> Does anyone see anything wrong with this code?
>

--
   +---------------------------------------------------------------+
   | 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