CODE HELP:autoexits

From: Tyler Wilhite/FASTTAX (
Date: 07/25/96

I have put in another flag on doors, EX_SECRET, where it will make a secret 
door.  I have made it so when you enter a room with a secret door, it will NOT 
show up on the autoexits, nor will it tell you the secret doors location simple 
by going in that direction bumping into the otherwise secret door, and it says 
'the <doorname> seems to be closed'.  It WILL show the secret door if it's 
opened though.  Also It'll show a # by a closed regular door.  What I am asking 
for is improvement on the code, I want to make this really efficient, I think 
the way my code is now, it's kinda kludgy.  So, feel free to to comment/help 
with this.
Objective, make it so, it uses the least amount of processor time, without 
using assembly.. ;) heh.

void do_auto_exits(struct char_data *ch)
        int door;

        *buf = '\0';

        for (door = 0; door < NUM_OF_DIRS; door++)
        if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE)
                if ((IS_SET(EXIT(ch, door)->exit_info, EX_SECRET))  &&
                (!IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)))
                sprintf(buf, "%s%s ", buf, dirs2[door]);
        else {
                if ((IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)) &&  
                (!IS_SET(EXIT(ch, door)->exit_info, EX_SECRET)))
                        sprintf(buf, "%s%s# ", buf, dirs2[door]);
                if (!IS_SET(EXIT(ch, door)->exit_info, EX_SECRET))
                        sprintf(buf, "%s%s ", buf, dirs2[door]);

        sprintf(buf2, "|02[ Exits: %s]|00\r\n",
                *buf ? buf : "None! ");

        send_to_char(buf2, ch);

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

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