View Single Post
Old April 28, 2007, 13:59   #3
Sangband 1.x Maintainer
camlost's Avatar
Join Date: Apr 2007
Posts: 522
camlost is on a distinguished road
'Secret Doors'

I'm still having trouble with the secret doors. By moving into a secret door, you get to the tunneling code. The problem is that you need to differentiate secret doors from secret doors that are known. I fixed this by adding

 * Determine if a grid is a closed door.
 * Open or broken doors, as well as secret doors don't count.
#define cave_closed_door(Y,X) \
   (f_info[cave_feat[Y][X]].flags & (TF_DOOR_CLOSED) && !(cave_feat[Y][X] == FEAT_SECRET))

 * Determine if a grid contains a secret door
#define cave_secret_door(Y,X) \
   ((cave_feat[Y][X] == FEAT_SECRET))

 * Determine if a grid is any door.
#define cave_any_door(Y,X) \
   (f_info[cave_feat[Y][X]].flags & (TF_DOOR_ANY))

 * Determine if a grid contains an open door

#define cave_open_door(Y,X) \
   ((cave_feat[Y][X] == FEAT_OPEN))
Also, you will probably want to examine any existing uses of these functions to make sure they remain correct.

The problem occurs when the auto-interact code thinks "it's a door", so goes to the auto-do function, which sees granite and starts tunneling. I don't recall the correct names of those functions.
camlost is offline   Reply With Quote