Re: [CODE] SKILL_RETREAT

From: Andy Hubbard (hub@LEICESTER.AC.UK)
Date: 02/11/98


>    One of the things I would like some help on is getting from the
>direction argument to the interger direction... the way I do it
>here(with a switch) is pure slop... is there a more efficent way?

eek, just switched to MS Outlook so I hope this format is OK, let me know
.....

for the directions try ...

/*start code*/

int retreat_type;

char *retreat_dirs[] = {
   "north",
   "east",
   "south",
   "west",
   "up",
   "down",
   "\n"
 };
 retreat_type = search_block(argument + 1, retreat_dirs, FALSE);
 if (retreat_type < 0 || !EXIT(ch, retreat_type) ||
  EXIT(ch, retreat_type)->to_room == NOWHERE) {
  send_to_char("Retreat where?\r\n", ch);
  return;
 }

/* end code */

               #####  DreamScapes MUD  (playtest)  #####
Endure no Immitations for They Will Surely Become Your Nightmares
                        telnet://winnt.cmht.le.ac.uk:4000
                    http://winnt.cmht.le.ac.uk/ds/main.html


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