Re: [OLC] [Dig Command]

From: Thomas Arp (t_arp@mail1.stofanet.dk)
Date: 09/07/00


As far as I can see you've tried to expand the dig command to work on diagonal
exits too. This calls for a little change. Also OLC_SAVE_ROOM has been changed to
SL_WLD in the newer versions of OasisOlc.

> ACMD(do_dig)
> {
> /* Only works if you have Oasis OLC */
- extern void olc_add_to_save_list(int zone, byte type);
This is now declared like this (as seen in genolc.c):
extern int olc_add_to_save_list(zone_vnum zone, int type);

<snip>
> /* Main stuff */
>     switch (*buf2) {

This takes the FIRST letter of buf2 and compares it throughout the switch.
This is also the reason for all your warnings, since no single char is ever equal
to a two-char string. You might want to try this angle instead:

if (!str_cmp(buf2,'n')  /*str_cmp is case insensitive*/
  dir = NORTH;
elseif (!str_cmp(buf2,'e')
  dir = EAST;
elseif (!str_cmp(buf2,'ne')
  dir = NORTHEAST;
etc.. etc..
else {
  send_to_char("That is not a valid direction!\r\n", ch);
  return;
}

<snip of creation of the exits>

> /* Only works if you have Oasis OLC */

olc_add_to_save_list() now uses another syntax:

   olc_add_to_save_list((iroom/100), SL_WLD);

> Being new to coding (learning as I go) I dont understand all this.
> Im not sure where or how to make the 'OLC_SAVE_ROOM' declared anywhere.
> I also dont quite follow all the warnings being stated as well.
> Any form of help will be appreciated.

Well I hope this is at least SOME help.. The usual disclaimer applies - it's mailer code,
and if your computer blows up so your house burns down, I'm not to blame :)

Welcor


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



This archive was generated by hypermail 2b30 : 04/11/01 PDT