else if (darkened_grid(c_ptr))
{
/* Unsafe cave grid -- idea borrowed from Unangband */
- feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? FEAT_UNDETECTED : FEAT_NONE;
+ feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access darkness */
f_ptr = &f_info[feat];
else
{
/* Unsafe cave grid -- idea borrowed from Unangband */
- if (view_unsafe_grids && (c_ptr->info & (CAVE_UNSAFE)))
- feat = FEAT_UNDETECTED;
- else
- feat = FEAT_NONE;
+ feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access darkness */
f_ptr = &f_info[feat];
if (have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT))
{
/* Unsafe cave grid -- idea borrowed from Unangband */
- feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? FEAT_UNDETECTED : FEAT_NONE;
+ feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access darkness */
f_ptr = &f_info[feat];
else
{
/* Unsafe cave grid -- idea borrowed from Unangband */
- if (view_unsafe_grids && (c_ptr->info & (CAVE_UNSAFE)))
- feat = FEAT_UNDETECTED;
- else
- feat = FEAT_NONE;
+ feat = (view_unsafe_grids && (c_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
/* Access feature */
f_ptr = &f_info[feat];
c_ptr->info |= (CAVE_MARK);
}
}
+
+ /* Memorize terrain of the grid */
+ c_ptr->info |= (CAVE_KNOWN);
}
/* Clear out-of-bound tiles */
/* Access darkness */
- feature_type *f_ptr = &f_info[FEAT_NONE];
+ feature_type *f_ptr = &f_info[feat_none];
/* Normal attr */
a = f_ptr->x_attr[F_LIT_STANDARD];
for (y = 0; y < (hgt + 2); y++)
{
/* Free one row each array */
- C_FREE(ma[y], (wid + 2), byte);
- C_FREE(mc[y], (wid + 2), char);
- C_FREE(mp[y], (wid + 2), byte);
- C_FREE(match_autopick_yx[y], (wid + 2), int);
- C_FREE(object_autopick_yx[y], (wid + 2), object_type **);
+ C_KILL(ma[y], (wid + 2), byte);
+ C_KILL(mc[y], (wid + 2), char);
+ C_KILL(mp[y], (wid + 2), byte);
+ C_KILL(match_autopick_yx[y], (wid + 2), int);
+ C_KILL(object_autopick_yx[y], (wid + 2), object_type *);
}
/* Free each line map */
- C_FREE(ma, (hgt + 2), byte_ptr);
- C_FREE(mc, (hgt + 2), char_ptr);
- C_FREE(mp, (hgt + 2), byte_ptr);
- C_FREE(match_autopick_yx, (hgt + 2), sint_ptr);
- C_FREE(object_autopick_yx, (hgt + 2), object_type **);
+ C_KILL(ma, (hgt + 2), byte_ptr);
+ C_KILL(mc, (hgt + 2), char_ptr);
+ C_KILL(mp, (hgt + 2), byte_ptr);
+ C_KILL(match_autopick_yx, (hgt + 2), sint_ptr);
+ C_KILL(object_autopick_yx, (hgt + 2), object_type **);
/* Free each line map */
for (y = 0; y < (cur_hgt + 2); y++)
{
/* Free one row each array */
- C_FREE(bigma[y], (cur_wid + 2), byte);
- C_FREE(bigmc[y], (cur_wid + 2), char);
- C_FREE(bigmp[y], (cur_wid + 2), byte);
+ C_KILL(bigma[y], (cur_wid + 2), byte);
+ C_KILL(bigmc[y], (cur_wid + 2), char);
+ C_KILL(bigmp[y], (cur_wid + 2), byte);
}
/* Free each line map */
- C_FREE(bigma, (cur_hgt + 2), byte_ptr);
- C_FREE(bigmc, (cur_hgt + 2), char_ptr);
- C_FREE(bigmp, (cur_hgt + 2), byte_ptr);
+ C_KILL(bigma, (cur_hgt + 2), byte_ptr);
+ C_KILL(bigmc, (cur_hgt + 2), char_ptr);
+ C_KILL(bigmp, (cur_hgt + 2), byte_ptr);
}
if (d > p) continue;
/* Viewable, nearby, grids get "torch lit" */
- if (player_has_los_bold(y, x))
+ if (cave[y][x].info & CAVE_VIEW)
{
/* This grid is "torch lit" */
cave_lite_hack(y, x);
c_ptr = &cave[y][x];
+ /* Memorize terrain of the grid */
+ c_ptr->info |= (CAVE_KNOWN);
+
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
f_ptr = &f_info[feat];
{
cave_type *c_ptr = &cave[y][x];
+ /* Memorize terrain of the grid */
+ c_ptr->info |= (CAVE_KNOWN);
+
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(c_ptr);
f_ptr = &f_info[feat];
cave_type *c_ptr = &cave[y][x];
/* Process the grid */
- c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT);
+ c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
c_ptr->info |= (CAVE_UNSAFE);
}
}
if (o_ptr->held_m_idx) continue;
/* Forget the object */
- o_ptr->marked = 0;
+ o_ptr->marked &= OM_TOUCHED;
}
+ /* Forget travel route when we have forgotten map */
+ forget_travel_flow();
+
/* Mega-Hack -- Forget the view and lite */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
if (have_flag(f_ptr->flags, FF_CONVERT))
{
- switch (f_ptr->power)
+ switch (f_ptr->subtype)
{
case CONVERT_TYPE_FLOOR:
return floor_type[randint0(100)];
*
* All disturbance cancels repeated commands, resting, and running.
*/
-void disturb(int stop_search, int unused_flag)
+void disturb(int stop_search, int stop_travel)
{
+#ifndef TRAVEL
/* Unused */
- unused_flag = unused_flag;
+ stop_travel = stop_travel;
+#endif
/* Cancel auto-commands */
/* command_new = 0; */
p_ptr->update |= (PU_FLOW);
}
+#ifdef TRAVEL
+ if (stop_travel)
+ {
+ /* Cancel */
+ travel.run = 0;
+
+ /* Check for new panel if appropriate */
+ if (center_player && !center_running) verify_panel();
+
+ /* Calculate torch radius */
+ p_ptr->update |= (PU_TORCH);
+ }
+#endif
+
/* Flush the input if requested */
if (flush_disturb) flush();
}