Re: [CODE] [NEWBIE] more exits

From: Sammy (samedi@DHC.NET)
Date: 06/10/98


On Sun, 8 Jun 1998, Kevin wrote:

> I was able to patch the exits code from the ftp site, but i noticed that i
> cannot open a door in a specific direction.  I have already RTFC and would
> appreciate any help.

Sorry I don't know that code well enough to help, and don't have the time
to look it up.

> Also, i made it so i can use oasisOLC to use the code when building, but i
> can't seem to get obuild to use it.  I know it has something to do with
> if-else statements, but i need help.

It's easy.  I'm assuming you found the comment about switching from case
statements to if-else in do_rset.  The if-else code will look something
like:

if(!str_cmp(arg1, "n"))
  direct = 0;
else if(!str_cmp(arg1, "e"))
  direct = 1;
else if(!str_cmp(arg1, "s"))
  direct = 2;
else if(!str_cmp(arg1, "w"))
  direct = 3;
else if(!str_cmp(arg1, "u"))
  direct = 4;
else if(!str_cmp(arg1, "d"))
  direct = 5;
else if(!str_cmp(arg1, "ne"))
  direct = 6;
else if(!str_cmp(arg1, "se"))
  direct = 7;
else if(!str_cmp(arg1, "sw"))
  direct = 8;
else if(!str_cmp(arg1, "nw"))
  direct = 9;
else {
  send_to_char("Invalid direction", ch);
  return;
}

Even better would be to set up an array of direction commands and their
NORTH/EAST/etc macros to search, but this will work fine.

Sam


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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