Known grids are those directly viewed by player or detected by mapping area magic
#define cave_view_hack(C,Y,X) \
{\
if (!((C)->info & (CAVE_VIEW))){\
- (C)->info |= (CAVE_VIEW); \
+ (C)->info |= (CAVE_VIEW | CAVE_KNOWN); \
view_y[view_n] = (Y); \
view_x[view_n] = (X); \
view_n++;}\
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);
}
}
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);
/* Ignore "pre-stamped" entries */
if (travel.cost[y][x] != TRAVEL_UNABLE) return wall;
+ /* Ignore unknown grid */
+ if (!(c_ptr->info & CAVE_KNOWN)) return wall;
+
/* Ignore "walls" and "rubble" (include "secret doors") */
if (have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
/* Used only after cave generation */
-#define CAVE_XXXX1 0x0200
+#define CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */
#define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */
#define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */
#define CAVE_OBJECT 0x1000 /* Mirror, glyph, etc. */
#endif
/* cmd2.c */
+extern void forget_travel_flow(void);
extern bool confirm_leave_level(bool down_stair);
extern void do_cmd_go_up(void);
extern void do_cmd_go_down(void);
c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
/* Lose light and knowledge */
- c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW);
+ c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN);
if (!in_generate) /* Normal */
{
c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
/* Lose light and knowledge */
- c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
+ c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
/* Skip the epicenter */
if (!dx && !dy) continue;