* @param x x座標
* @return 指定された座標に照明がかかっているならTRUEを返す。。
*/
-bool check_local_illumination(POSITION y, POSITION x)
+bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x)
{
/* Hack -- move towards player */
- POSITION yy = (y < p_ptr->y) ? (y + 1) : (y > p_ptr->y) ? (y - 1) : y;
- POSITION xx = (x < p_ptr->x) ? (x + 1) : (x > p_ptr->x) ? (x - 1) : x;
+ POSITION yy = (y < creature_ptr->y) ? (y + 1) : (y > creature_ptr->y) ? (y - 1) : y;
+ POSITION xx = (x < creature_ptr->x) ? (x + 1) : (x > creature_ptr->x) ? (x - 1) : x;
/* Check for "local" illumination */
#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
/* Check for "complex" illumination */
- if ((feat_supports_los(get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[yy][xx])) &&
- (p_ptr->current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[y][xx])) &&
- (p_ptr->current_floor_ptr->grid_array[y][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[yy][x])) &&
- (p_ptr->current_floor_ptr->grid_array[yy][x].info & CAVE_GLOW)))
+ if ((feat_supports_los(get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[yy][xx])) &&
+ (creature_ptr->current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[y][xx])) &&
+ (creature_ptr->current_floor_ptr->grid_array[y][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[yy][x])) &&
+ (creature_ptr->current_floor_ptr->grid_array[yy][x].info & CAVE_GLOW)))
{
return TRUE;
}
#else /* COMPLEX_WALL_ILLUMINATION */
/* Check for "simple" illumination */
- return (p_ptr->current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
+ return (creature_ptr->current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
#endif /* COMPLEX_WALL_ILLUMINATION */
}
}
/* Memorize certain non-torch-lit wall grids */
- else if (check_local_illumination(y, x))
+ else if (check_local_illumination(p_ptr, y, x))
{
g_ptr->info |= (CAVE_MARK);
}
extern void cave_alter_feat(POSITION y, POSITION x, int action);
extern void remove_mirror(POSITION y, POSITION x);
extern bool is_open(FEAT_IDX feat);
-extern bool check_local_illumination(POSITION y, POSITION x);
+extern bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
extern bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode);
extern bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode);
}
/* Not glowing correctly */
- else if (!have_flag(f_ptr->flags, FF_LOS) && !check_local_illumination(y, x))
+ else if (!have_flag(f_ptr->flags, FF_LOS) && !check_local_illumination(p_ptr, y, x))
{
/* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];