/*
* Determine if a "legal" grid is an "naked" floor grid
*
- * Line 1 -- forbid non-placers
+ * Line 1 -- forbid non-projectables
* Line 2 -- forbid non-droppers
- * Line 3 -- forbid permanent
- * Line 4 -- forbid object terrains
- * Line 5 -- forbid normal objects
- * Line 6 -- forbid monsters
- * Line 7 -- forbid the player
+ * Line 3 -- forbid doors
+ * Line 4 -- forbid permanent
+ * Line 5 -- forbid object terrains
+ * Line 6 -- forbid normal objects
+ * Line 7 -- forbid monsters
+ * Line 8 -- forbid the player
*/
#define cave_naked_bold(Y,X) \
- (have_flag(f_flags_bold((Y), (X)), FF_DROP) && \
+ (have_flag(f_flags_bold((Y), (X)), FF_PROJECT) && \
+ have_flag(f_flags_bold((Y), (X)), FF_DROP) && \
+ !have_flag(f_flags_bold((Y), (X)), FF_DOOR) && \
!have_flag(f_flags_bold((Y), (X)), FF_PERMANENT) && \
!(cave[Y][X].info & CAVE_OBJECT) && \
!(cave[Y][X].o_idx) && \
case GF_LAVA_FLOW:
{
/* Shallow Lava */
- if(dam == 1)
+ if (dam == 1)
{
/* Require a "naked" floor grid */
if (!cave_naked_bold(y, x)) break;
cave_set_feat(y, x, FEAT_SHAL_LAVA);
}
/* Deep Lava */
- else
+ else if (dam)
{
/* Require a "naked" floor grid */
- if (cave_perma_bold(y, x) || !dam) break;
+ if (cave_perma_bold(y, x)) break;
/* Place a deep lava */
cave_set_feat(y, x, FEAT_DEEP_LAVA);
-
- /* Dam is used as a counter for the number of grid to convert */
- dam--;
}
break;
}
case GF_WATER_FLOW:
{
/* Shallow Water */
- if(dam == 1)
+ if (dam == 1)
{
/* Require a "naked" floor grid */
if (!cave_naked_bold(y, x)) break;
cave_set_feat(y, x, FEAT_SHAL_WATER);
}
/* Deep Water */
- else
+ else if (dam)
{
/* Require a "naked" floor grid */
- if (cave_perma_bold(y, x) || !dam) break;
+ if (cave_perma_bold(y, x)) break;
/* Place a deep lava */
cave_set_feat(y, x, FEAT_DEEP_WATER);
-
- /* Dam is used as a counter for the number of grid to convert */
- dam--;
}
break;
}
while (--attempts)
{
scatter(&wy, &wx, py, px, 3, 0);
- if (cave_naked_bold(wy, wx)) break;
+ if (cave_empty_bold(wy, wx)) break;
}
(void)alloc_horde(wy, wx);