Re: Getting directions

From: Zeavon (
Date: 03/31/99

On Wed, 31 Mar 1999, Del wrote:

> Is there a function to get the opposite direction of a movement?

  sprintf(buf, "$n has arrived from %s%s.",
               (dir < UP ? "the " : ""),
               (dir == UP ? "below": dir == DOWN ?
               "above" : dirs[rev_dir[dir]]));

This code will do:
<NAME> has arrived from ...
...above.   (instead of "the up")
...below.   (instead of "the down")
...the north.
...the south.
...the east.
...the west.

Note the use of rev_dir[] which can be found in contants.c.

Zeavon MageMaster
Implementor of The Spear of Insanity
  MUD: 1066
  Web:  (Still under construction)

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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