Re: [OLC] [Dig Command]

From: Ryan Corbett (wizard15@home.com)
Date: 09/06/00


Matthew Kuebbeler wrote:
>
> Im currently using circle30bpl17 with the Oasis patch for it.
> I've recently attempted to add in the dig command found from the ftp site,
> but as always, nothing ever seems to go in right the first time.
>
> Heres the snippet:
>
> ACMD(do_dig)
> {
> /* Only works if you have Oasis OLC */
> extern void olc_add_to_save_list(int zone, byte type);
>
>   char buf2[10];
>   char buf3[10];
>   char buf[80];
>   int iroom = 0, rroom = 0;
>   int dir = 0;
> /*  struct room_data *room; */
>
>   two_arguments(argument, buf2, buf3);
>   /* buf2 is the direction, buf3 is the room */
>
> iroom = atoi(buf3);
>
> rroom = real_room(iroom);
>
>  if (!*buf2) {
>     send_to_char("Format: dig <dir> <room number>\r\n", ch);
>     return; }
>  else if (!*buf3) {
>     send_to_char("Format: dig <dir> <room number>\r\n", ch);
>     return; }
>  if (rroom <= 0) {
>
> sprintf(buf, "There is no room with the number %d", iroom);
>
> send_to_char(buf, ch);
>
> return; }
> /* Main stuff */
>     switch (*buf2) {
>     case 'n':
>     case 'N':
>       dir = NORTH;
>       break;
>     case 'e':
>     case 'E':
>       dir = EAST;
>       break;
>     case 's':
>     case 'S':
>       dir = SOUTH;
>       break;
>     case 'w':
>     case 'W':
>       dir = WEST;
>       break;
>     case 'u':
>     case 'U':
>       dir = UP;
>       break;
>     case 'd':
>     case 'D':
>       dir = DOWN;
>       break;
>     case 'ne':
>     case 'NE':
>       dir = NORTHEAST;
>       break;
>     case 'nw':
>     case 'NW':
>       dir = NORTHWEST;
>       break;
>     case 'se':
>     case 'SE':
>       dir = SOUTHEAST;
>       break;
>     case 'sw':
>     case 'SW':
>       dir = SOUTHWEST;
>       break;
>  }
>
> CREATE(world[rroom].dir_option[rev_dir[dir]], struct room_direction_data,1);
>   world[rroom].dir_option[rev_dir[dir]]->general_description = NULL;
>   world[rroom].dir_option[rev_dir[dir]]->keyword = NULL;
>   world[rroom].dir_option[rev_dir[dir]]->to_room = ch->in_room;
>
> CREATE(world[ch->in_room].dir_option[dir], struct room_direction_data,1);
>   world[ch->in_room].dir_option[dir]->general_description = NULL;
>   world[ch->in_room].dir_option[dir]->keyword = NULL;
>   world[ch->in_room].dir_option[dir]->to_room = rroom;
>
> /* Only works if you have Oasis OLC */
>   olc_add_to_save_list((iroom/100), OLC_SAVE_ROOM);
>
>  sprintf(buf, "You make an exit %s to room %d.\r\n", buf2, iroom);
>  send_to_char(buf, ch);
> }
>
> Now heres what the make has to say:
>
> make ../bin/circle
> make[1]: Entering directory `/usr/circle/circle30bpl17/src'
> gcc -g -O2 -Wall    -c act.wizard.c -o act.wizard.o
> act.wizard.c: In function `do_dig':
> act.wizard.c:3044: warning: multi-character character constant
> act.wizard.c:3044: warning: case value out of range
> act.wizard.c:3045: warning: multi-character character constant
> act.wizard.c:3045: warning: case value out of range
> act.wizard.c:3048: warning: multi-character character constant
> act.wizard.c:3048: warning: case value out of range
> act.wizard.c:3049: warning: multi-character character constant
> act.wizard.c:3049: warning: case value out of range
> act.wizard.c:3052: warning: multi-character character constant
> act.wizard.c:3052: warning: case value out of range
> act.wizard.c:3053: warning: multi-character character constant
> act.wizard.c:3053: warning: case value out of range
> act.wizard.c:3056: warning: multi-character character constant
> act.wizard.c:3056: warning: case value out of range
> act.wizard.c:3057: warning: multi-character character constant
> act.wizard.c:3057: warning: case value out of range
> act.wizard.c:3073: `OLC_SAVE_ROOM' undeclared (first use this function)
> act.wizard.c:3073: (Each undeclared identifier is reported only once
> act.wizard.c:3073: for each function it appears in.)
> make[1]: *** [act.wizard.o] Error 1
> make[1]: Leaving directory `/usr/circle/circle30bpl17/src'
> make: *** [all] Error 2
>
> 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.
>
> Matt
 I am Almost POSITIVE that include olc.h in the file will fix the
OLC_SAVE_ROOM, as it did on mine,
  hope this helps
 Ryan


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