Direction code problem(1)

From: Charles Erwin (Mystikarc@aol.com)
Date: 07/08/00


I use bpl17:
Code is for bpl17:
I recieved this warnign while coding ordinal directions:
objsave.c: In function `Crash_extract_norent_eq':
objsave.c:669: warning: unused variable `obj'

if anyone knows what this means, and can help me please I would appreciate it.
thank you very much.
the following is a clip of the code and where I got it from:

                 Ordinal Directions for 3.0bpl17 (nw, ne, sw, se) [by Khalun]

             Posted Saturday, June 17th @ 04:08:57 PM, by Brandon Brown in
the
            Rooms dept.
            Kkalun writes, "This is what I did to create ne, nw, se, and sw.
It
            seemed way easier than the other patches for ordinal
directions...."

const char *dirs[] =
{
  "north",
  "east",
  "south",
  "west",
  "up",
  "down",
  "northeast",
  "northwest",
  "southeast",
  "southwest",
  "\n"
};

And then, (also in constants.c) change int rev_dir[] to:

int rev_dir[] =
{
  2,
  3,
  0,
  1,
  5,
!  4,
+  7,
+  6,
+  9,
+  8
};

In interpreter.c, add the following lines after "down":

  { "down", POS_STANDING, do_move     , 0, SCMD_DOWN },
  { "northeast", POS_STANDING, do_move     , 0, SCMD_NORTHEAST },
  { "ne"       , POS_STANDING, do_move     , 0, SCMD_NORTHEAST },
  { "northwest", POS_STANDING, do_move     , 0, SCMD_NORTHWEST },
  { "nw"       , POS_STANDING, do_move     , 0, SCMD_NORTHWEST },
  { "southeast", POS_STANDING, do_move     , 0, SCMD_SOUTHEAST },
  { "se"       , POS_STANDING, do_move     , 0, SCMD_SOUTHEAST },
  { "southwest", POS_STANDING, do_move     , 0, SCMD_SOUTHWEST },
  { "sw"       , POS_STANDING, do_move     , 0, SCMD_SOUTHWEST },


In interpreter.h, change /* directions */ to read:

/* directions */
#define SCMD_NORTH      1
#define SCMD_EAST       2
#define SCMD_SOUTH      3
#define SCMD_WEST       4
#define SCMD_UP         5
#define SCMD_DOWN       6
#define SCMD_NORTHEAST  7
#define SCMD_NORTHWEST  8
#define SCMD_SOUTHEAST  9
#define SCMD_SOUTHWEST  10

In structs.h, do the following:

Change the NUM_OF_DIRS define to read:
#define NUM_OF_DIRS     10      /* number of directions in a room */

Then, change the direction defines as follows:

/* Directions: used as index to room_data.dir_option[] */
#define NORTH           0
#define EAST            1
#define SOUTH           2
#define WEST            3
#define UP              4
#define DOWN            5
#define NORTHEAST       6
#define NORTHWEST       7
#define SOUTHEAST       8
#define SOUTHWEST       9

If you have OasisOLC, you need to change the room edit menu in redit.c to
reflect the new directions.  I swiped most of this directly from StormRider's
new_exits.patch code, but I had to change some of it to reflect what was
going on with Oasis 2.0 - the new_exits patch was written in April of '97,
and things have moved on since then. ;)

In redit.c, change redit_disp_menu like this:

          "-- Room number : [%s%d%s]    Room zone: [%s%d%s]\r\n"
          "%s1%s) Name           : %s%s\r\n"
          "%s2%s) Description    :\r\n%s%s"
          "%s3%s) Room flags     : %s%s\r\n"
          "%s4%s) Sector type    : %s%s\r\n"
          "%s5%s) Exit north     : %s%d\r\n"
          "%s6%s) Exit east      : %s%d\r\n"
          "%s7%s) Exit south     : %s%d\r\n"
          "%s8%s) Exit west      : %s%d\r\n"
          "%s9%s) Exit up        : %s%d\r\n"
          "%sA%s) Exit down      : %s%d\r\n"
          "%sB%s) Exit northeast : %s%d\r\n"
          "%sC%s) Exit northwest : %s%d\r\n"
          "%sD%s) Exit southeast : %s%d\r\n"
          "%sE%s) Exit southwest : %s%d\r\n"
          "%sF%s) Extra descriptions menu\r\n"
          "%sQ%s) Quit\r\n"
          "Enter choice : ",

(there is more which will be in Dir Problem(2)


     +------------------------------------------------------------+
     | 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/10/01 PDT