if (p >= 2)
{
/* South of the player */
- if (cave_los_bold(subject_ptr->y + 1, subject_ptr->x))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y + 1, subject_ptr->x))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y + 2, subject_ptr->x);
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y + 2, subject_ptr->x + 1);
}
/* North of the player */
- if (cave_los_bold(subject_ptr->y - 1, subject_ptr->x))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y - 1, subject_ptr->x))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y - 2, subject_ptr->x);
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y - 2, subject_ptr->x + 1);
}
/* East of the player */
- if (cave_los_bold(subject_ptr->y, subject_ptr->x + 1))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y, subject_ptr->x + 1))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y, subject_ptr->x + 2);
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y + 1, subject_ptr->x + 2);
}
/* West of the player */
- if (cave_los_bold(subject_ptr->y, subject_ptr->x - 1))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y, subject_ptr->x - 1))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y, subject_ptr->x - 2);
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y + 1, subject_ptr->x - 2);
if (p > 14) p = 14;
/* South-East of the player */
- if (cave_los_bold(subject_ptr->y + 1, subject_ptr->x + 1))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y + 1, subject_ptr->x + 1))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y + 2, subject_ptr->x + 2);
}
/* South-West of the player */
- if (cave_los_bold(subject_ptr->y + 1, subject_ptr->x - 1))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y + 1, subject_ptr->x - 1))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y + 2, subject_ptr->x - 2);
}
/* North-East of the player */
- if (cave_los_bold(subject_ptr->y - 1, subject_ptr->x + 1))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y - 1, subject_ptr->x + 1))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y - 2, subject_ptr->x + 2);
}
/* North-West of the player */
- if (cave_los_bold(subject_ptr->y - 1, subject_ptr->x - 1))
+ if (cave_los_bold(p_ptr->current_floor_ptr, subject_ptr->y - 1, subject_ptr->x - 1))
{
cave_lite_hack(subject_ptr->current_floor_ptr, subject_ptr->y - 2, subject_ptr->x - 2);
}
* Note also the care taken to prevent "running off the map". The use of
* explicit checks on the "validity" of the "diagonal", and the fact that
* the loops are never allowed to "leave" the map, lets "update_view_aux()"
- * use the optimized "cave_los_bold()" macro, and to avoid the overhead
+ * use the optimized "cave_los_bold(p_ptr->current_floor_ptr, )" macro, and to avoid the overhead
* of multiple checks on the validity of grids.
*
* Note the "optimizations" involving the "se","sw","ne","nw","es","en",
* unless open space is still available. This uses the "k" variable.
*
* Note the use of "inline" macros for efficiency. The "cave_los_grid()"
- * macro is a replacement for "cave_los_bold()" which takes a pointer to
+ * macro is a replacement for "cave_los_bold(p_ptr->current_floor_ptr, )" which takes a pointer to
* a grid instead of its location. The "cave_view_hack()" macro is a
* chunk of code which adds the given location to the "view" array if it
* is not already there, using both the actual location and a pointer to
/* Only first wall viewed from mid-x is lit */
if (x < midpoint)
{
- if (!cave_los_bold(y, x + 1)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y, x + 1)) return;
}
else if (x > midpoint)
{
- if (!cave_los_bold(y, x - 1)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y, x - 1)) return;
}
/* Hack XXX XXX - Is it a wall and monster not in LOS? */
/* Only first wall viewed from mid-y is lit */
if (y < midpoint)
{
- if (!cave_los_bold(y + 1, x)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y + 1, x)) return;
}
else if (y > midpoint)
{
- if (!cave_los_bold(y - 1, x)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y - 1, x)) return;
}
/* Hack XXX XXX - Is it a wall and monster not in LOS? */
/* Only first wall viewed from mid-x is lit */
if (x < midpoint)
{
- if (!cave_los_bold(y, x + 1) && !cave_have_flag_bold(y, x + 1, FF_PROJECT)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y, x + 1) && !cave_have_flag_bold(y, x + 1, FF_PROJECT)) return;
}
else if (x > midpoint)
{
- if (!cave_los_bold(y, x - 1) && !cave_have_flag_bold(y, x - 1, FF_PROJECT)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y, x - 1) && !cave_have_flag_bold(y, x - 1, FF_PROJECT)) return;
}
/* Hack XXX XXX - Is it a wall and monster not in LOS? */
/* Only first wall viewed from mid-y is lit */
if (y < midpoint)
{
- if (!cave_los_bold(y + 1, x) && !cave_have_flag_bold(y + 1, x, FF_PROJECT)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y + 1, x) && !cave_have_flag_bold(y + 1, x, FF_PROJECT)) return;
}
else if (y > midpoint)
{
- if (!cave_los_bold(y - 1, x) && !cave_have_flag_bold(y - 1, x, FF_PROJECT)) return;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y - 1, x) && !cave_have_flag_bold(y - 1, x, FF_PROJECT)) return;
}
/* Hack XXX XXX - Is it a wall and monster not in LOS? */
}
else if (flg & (PROJECT_LOS))
{
- if ((n > 0) && !cave_los_bold(y, x)) break;
+ if ((n > 0) && !cave_los_bold(p_ptr->current_floor_ptr, y, x)) break;
}
else if (!(flg & (PROJECT_PATH)))
{
}
else if (flg & (PROJECT_LOS))
{
- if ((n > 0) && !cave_los_bold(y, x)) break;
+ if ((n > 0) && !cave_los_bold(p_ptr->current_floor_ptr, y, x)) break;
}
else if (!(flg & (PROJECT_PATH)))
{
}
else if (flg & (PROJECT_LOS))
{
- if ((n > 0) && !cave_los_bold(y, x)) break;
+ if ((n > 0) && !cave_los_bold(p_ptr->current_floor_ptr, y, x)) break;
}
else if (!(flg & (PROJECT_PATH)))
{
{
for (ty = y1 + 1; ty < y2; ty++)
{
- if (!cave_los_bold(ty, x1)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, ty, x1)) return FALSE;
}
}
{
for (ty = y1 - 1; ty > y2; ty--)
{
- if (!cave_los_bold(ty, x1)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, ty, x1)) return FALSE;
}
}
{
for (tx = x1 + 1; tx < x2; tx++)
{
- if (!cave_los_bold(y1, tx)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y1, tx)) return FALSE;
}
}
{
for (tx = x1 - 1; tx > x2; tx--)
{
- if (!cave_los_bold(y1, tx)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, y1, tx)) return FALSE;
}
}
{
if (ay == 2)
{
- if (cave_los_bold(y1 + sy, x1)) return TRUE;
+ if (cave_los_bold(p_ptr->current_floor_ptr, y1 + sy, x1)) return TRUE;
}
}
{
if (ax == 2)
{
- if (cave_los_bold(y1, x1 + sx)) return TRUE;
+ if (cave_los_bold(p_ptr->current_floor_ptr, y1, x1 + sx)) return TRUE;
}
}
/* the LOS exactly meets the corner of a tile. */
while (x2 - tx)
{
- if (!cave_los_bold(ty, tx)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, ty, tx)) return FALSE;
qy += m;
else if (qy > f2)
{
ty += sy;
- if (!cave_los_bold(ty, tx)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, ty, tx)) return FALSE;
qy -= f1;
tx += sx;
}
/* the LOS exactly meets the corner of a tile. */
while (y2 - ty)
{
- if (!cave_los_bold(ty, tx)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, ty, tx)) return FALSE;
qx += m;
else if (qx > f2)
{
tx += sx;
- if (!cave_los_bold(ty, tx)) return FALSE;
+ if (!cave_los_bold(p_ptr->current_floor_ptr, ty, tx)) return FALSE;
qx -= f1;
ty += sy;
}