View Single Post
Old April 29, 2007, 17:25   #6
camlost
Sangband 1.x Maintainer
 
camlost's Avatar
 
Join Date: Apr 2007
Posts: 522
camlost is on a distinguished road
I don't really know much about the terrain code, but presumable cave_wall_bold is not actually flagging secret doors as "walls".

Code:
			/* Wall (or secret door) */
			else if (cave_wall_bold(y, x))
			{
				/* Already known */
				if (cave_info[y][x] & (CAVE_MARK))
				{
					message(MSG_HITWALL, 0, "There is a wall in your way.");

					/* Hack -- Use no energy */
					if (!p_ptr->confused) p_ptr->energy_use = 0;
				}
				/* Not known */
				else
				{
					message(MSG_HITWALL, 0, "You feel a wall blocking your way.");
					cave_info[y][x] |= (CAVE_MARK);
					lite_spot(y, x);
				}
			}
Code:
/*
 * Determine if a grid is a "wall"
 */
#define cave_wall_bold(Y,X) \
	 (f_info[cave_feat[Y][X]].flags & (TF_WALL))
Code:
/*
 * Place a secret door at the given location
 */
static void place_secret_door(int y, int x)
{
	/* Create secret door */
	cave_set_feat(y, x, FEAT_SECRET);
}
My solution was to add in some explicit tests for secret doors rather than fix the problem with cave_wall_bold. I'm not even sure where TF_WALL gets set in the code.

Would setting TF_WALL in place_secret_door solve anything? I'm guessing it's at the very least, the wrong way to do things.
camlost is offline   Reply With Quote