Bored. Atrack.

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 04/05/98


        I was bored. This tiny snippet makes it so instead of having to
type track in each room, each time you move, this does it for you
automagically.

                                PjD
prototype add to act.informative.c

   int find_first_step(sh_int src, sh_int target);

 in look_at_room() (same file), add the following right after the room
desc.

  /* list auto track */

  if(TARGET_ROOM(ch) != NOWHERE && TARGET_ROOM(ch) != ch->in_room) {
    sprintf(buf, "You sense a trail %s from here!\r\n",
      dirs[find_first_step(ch->in_room, TARGET_ROOM(ch))]);
    send_to_char(buf, ch);
  } else if (TARGET_ROOM(ch) == ch->in_room) {
    TARGET_ROOM(ch)=NOWHERE;
  }

 in db.c, add the following to reset_char, in the same place where
ch->in_room is set to NOWHERE.

 ch->target_room=NOWHERE;

  in graph.c, in do_track, add the folowing after the room has
found..etc..
    TARGET_ROOM(ch)=vict->in_room;

and in utils.h, add this define:

#define TARGET_ROOM(ch)  ((ch)->target_room)

                        Thats it.


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