POSITION ny, nx;
/* Stagger around */
- while (cave_perma_bold(floor_ptr, y, x) || floor_ptr->grid_array[y][x].o_idx || (floor_ptr->grid_array[y][x].info & CAVE_OBJECT))
+ while (cave_have_flag_bold(floor_ptr, y, x, FF_PERMANENT) || floor_ptr->grid_array[y][x].o_idx || (floor_ptr->grid_array[y][x].info & CAVE_OBJECT))
{
/* Pick a location */
scatter(player_ptr, &ny, &nx, y, x, 1, 0);
return cave_have_flag_bold(floor_ptr, y, x, FF_FLOOR) && ((floor_ptr->grid_array[y][x].info & CAVE_OBJECT) == 0)
&& (floor_ptr->grid_array[y][x].o_idx == 0);
}
+
+/*
+ * Determine if an object can be dropped on a "legal" grid
+ *
+ * Line 1 -- forbid non-drops
+ * Line 2 -- forbid object terrains
+ */
+bool cave_drop_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+{
+ return cave_have_flag_bold(floor_ptr, y, x, FF_DROP) && ((floor_ptr->grid_array[y][x].info & CAVE_OBJECT) == 0);
+}
bool cave_los_grid(grid_type *grid_ptr);
bool cave_have_flag_grid(grid_type *grid_ptr, int feature_flags);
bool cave_clean_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+bool cave_drop_bold(floor_type *floor_ptr, POSITION y, POSITION x);
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "floor/cave.h"
-#include "floor/floor.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/floor-generate.h"
continue;
/* Do not convert permanent features */
- if (cave_perma_grid(g_ptr))
+ if (cave_have_flag_grid(g_ptr, FF_PERMANENT))
continue;
/*
continue;
/* Want square to be in the circle and accessable. */
- if ((distance(j, i, y, x) < 4) && !cave_perma_grid(g_ptr)) {
+ if ((distance(j, i, y, x) < 4) && !cave_have_flag_grid(g_ptr, FF_PERMANENT)) {
/*
* Clear previous contents, add feature
* The border mainly gets trees, while the center gets rubble
bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x)
{
grid_type *g_ptr = &floor_ptr->grid_array[y][x];
- if (cave_perma_grid(g_ptr))
+ if (cave_have_flag_grid(g_ptr, FF_PERMANENT))
return FALSE;
OBJECT_IDX next_o_idx = 0;
/*
- * Determine if an object can be dropped on a "legal" grid
- *
- * Line 1 -- forbid non-drops
- * Line 2 -- forbid object terrains
- */
-#define cave_drop_bold(F,Y,X) \
- (cave_have_flag_bold((F), (Y), (X), FF_DROP) && \
- !((F)->grid_array[Y][X].info & CAVE_OBJECT))
-
-
-/*
- * Determine if a "legal" grid is "permanent"
- *
- * Line 1 -- permanent flag
- */
-#define cave_perma_bold(F,Y,X) \
- (cave_have_flag_bold((F), (Y), (X), FF_PERMANENT))
-
-
-/*
- * Grid based version of "cave_perma_bold()"
- */
-#define cave_perma_grid(C) \
- (cave_have_flag_grid((C), FF_PERMANENT))
-
-
-/*
* Determine if a "legal" grid is within "los" of the player
*
* Note the use of comparison to zero to force a "boolean" result
delete_all_items_from_floor(caster_ptr, y, x);
/* Destroy "non-permanent" grids */
- if (cave_perma_grid(g_ptr))
+ if (cave_have_flag_grid(g_ptr, FF_PERMANENT))
continue;
/* Wall (or floor) type */