Re: Special Procs

jelson@blaze.cs.jhu.edu
Date: 02/07/94


> I've decided to try to write a "teleporter" room for my MUD... so I wrote
> this and put it in spec_procs.c:
> 
> SPECIAL(transport)
> {
>   int rnwhereto = number(1,3);
>   int whereto = 0;
> 
>   ACMD(do_look);
> 
>   if (IS_NPC(ch) || (cmd != 302))
>     return(FALSE);
> 
>   switch(rnwhereto) {
>     case 1:
>        whereto = 3001; break;
>     case 2:
>        whereto = 12032; break;
>     case 3:
>        whereto = 7009; break;
>     }
> 
>   act("$n presses a button on the transporter, and disappears.", TRUE, ch, 0,
> 0, TO_ROOM);
>   send_to_char("You press a button on the transporter..\n\r", ch);
>   char_from_room(ch);
>   char_to_room(ch, whereto);
[..]
> And then a crash.. Anyone know what I have done wrong here?

Yes.  char_to_room() uses an rnum, not a vnum.  3001, 12032, and 7009
look like they are vnums.  Use real_room() to convert a vnum to an
rnum.

-je



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