Ok, Ive seen this question asked before and it is sorta easy, so I figured
I'd put this out
to the list and let folks have at what they will. This Sorta-Snip basically
lets Doors in exits
be seen(instead of disappearing like in stock. and also put a () around the
exit as in the
following example:   [Exits: south (up)]  Of course up being the door in
this case. I just
included the whole do_exits function that was you can see it all. Of course
we use Lopes
and also have extraexits...so you may need to change the '{'s and also need
to change the
9 to a 5 if you have standard exit. Anyway, Just a lil something.

=========================Start of
DO_EXIT=========================================================

void do_exits (CHAR_DATA * ch, char *argument)
{
    extern char *const dir_name[];
    char buf[MAX_STRING_LENGTH];
    EXIT_DATA *pexit;
    bool found;
    bool fAuto;
    int door;

    fAuto = !str_cmp (argument, "auto");

    if (!check_blind (ch))
        return;

    if (fAuto)
        sprintf (buf, "{W[{RExits{W:{R");
    else if (IS_IMMORTAL (ch))
        sprintf (buf, "Obvious exits from room %d:\n\r", ch->in_room->vnum);
    else
        sprintf (buf, "Obvious exits:\n\r");

    found = FALSE;
    for (door = 0; door <= 9; door++)   /* please change the 9 to 5 if you
dont have extra exits */
    {
        if ((pexit = ch->in_room->exit[door]) != NULL
            && pexit->u1.to_room != NULL
            && can_see_room (ch, pexit->u1.to_room))
        {
            found = TRUE;
            if (fAuto)
            {
                strcat (buf, " ");
                if (IS_SET (pexit->exit_info, EX_CLOSED))
                {
                strcat (buf, "{r({R");
                strcat (buf, dir_name[door]);
                strcat (buf, "{r){R");
                }
                else
                strcat (buf, dir_name[door]);
            }
            else
            {
                if (!IS_SET (pexit->exit_info, EX_CLOSED)) {
                sprintf (buf + strlen (buf), "%-5s - %s",
                         capitalize (dir_name[door]),
                         room_is_dark (pexit->u1.to_room)
                         ? "Too dark to tell" : pexit->u1.to_room->name);
                if (IS_IMMORTAL (ch))
                    sprintf (buf + strlen (buf),
                             " (room %d)\n\r", pexit->u1.to_room->vnum);
                else
                    sprintf (buf + strlen (buf), "\n\r");
              }
            }
        }
    }

    if (!found)
        strcat (buf, fAuto ? " none" : "None.\n\r");

    if (fAuto)
        strcat (buf, "{W]{x\n\r");

    send_to_char (buf, ch);
    return;
}
===========================End of
Code=============================================



Reply via email to