[Circle] [Code] Secret Doors help.

From: DJ Pure (pure@ozramp.net.au)
Date: 11/27/96

G'ady all.
I've tried to add secret doors to my code. Well. it doesn't seem to
"pickup" that a doors is secret. It displays secret doors as Normal closed
doors. I don't know how to find what the BITFLAG is set for door.

I've done this.

<In structs.h>
// Exit info: used in room_data.dir_option.exit_info 
#define EX_ISDOOR		(1 << 0)   // Exit is a door		
#define EX_CLOSED		(1 << 1)   // The door is closed	
#define EX_LOCKED		(1 << 2)   // The door is locked	
#define EX_PICKPROOF	(1 << 3)   // Lock can't be picked	
#define EX_SECRET		(1 << 4)   // The door is secret and can be opened.
#define EX_SECRET_LOCKED (1 << 5)  // The secret door is locked
#define EX_SECRET_PP    (1 << 6)   // The secret door can't be picked.

<in act.informative.c>
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_SECRET_LOCKED)) ||
			(IS_SET(EXIT(ch, door)->exit_info, EX_SECRET_PP)) )
			// don't print anything to the character.
			// For testing, i'm just having is say it's a Secret.
			sprintf (buf, "%s -%s[Secret]", buf, capdirs[door]);
        else if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
           sprintf(buf, "%s-%s# ", buf, capdirs[door]);
           sprintf(buf, "%s-%s ", buf, capdirs[door]);

  sprintf(buf2, "%s[ Exits: %s]%s\r\n", CCCYN(ch, C_NRM),
	  *buf ? buf : "None! ", CCNRM(ch, C_NRM));

  send_to_char(buf2, ch);

Also, what does this mean ??
     if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE)
my guess is this. That the door direction (0=north, etc) is in the room as
the char AND that the door in the room DOESN'T point to the NOWHERE room.
Also, (if this is the case) why bother having the check to the NOWHERE


| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |

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