Problems with Ferry Snippet

From: Moppe Sewerin (mans@graphiclife.com)
Date: 03/30/02


Hi again!

Perhaps any of you who tried the ferry snippet would like to help me
with this one?

Function Create Exit screws the whole room up if you already have an
exit there:

/* Beginning of Code */
void create_exit(room_vnum vnum_from, room_vnum vnum_to, int from_dir)
{
   char cebuf[128];
   room_rnum rnum_from, rnum_to;

   if ((rnum_from = real_room(vnum_from)) == NOWHERE) {
     sprintf(cebuf, "SYSERR: Ferry: Couldn't find the 'from' room #%d.",
vnum_from);
     log(cebuf);
   } else if ((rnum_to = real_room(vnum_to)) == NOWHERE) {
     sprintf(cebuf, "SYSERR: Ferry: Couldn't find the 'to' room #%d.",
vnum_to);
     log(cebuf);
   } else if (world[rnum_from].dir_option[from_dir] == NULL) {
     CREATE(world[rnum_from].dir_option[from_dir], struct
room_direction_data, 1);
     world[rnum_from].dir_option[from_dir]->to_room = rnum_to;
   } else {
     sprintf(cebuf, "SYSERR: Ferry overwriting exit in room #%d.",
world[rnum_from].number);
     log(cebuf);
     world[rnum_from].dir_option[from_dir]->to_room = rnum_to;
   }
}
/* End of Code */


Any real hacker who could localize the problem? I'd be really glad if
you could help me.

Regards

Måns Sewerin

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT