OSDN Git Service

[Refactor] #37353 spells.hにスペルに関する共通定義を追加。。 / Add common definition to spells.h.
[hengband/hengband.git] / src / cave.c
index 7c531ec..f0a6800 100644 (file)
@@ -574,7 +574,6 @@ bool player_can_see_bold(POSITION y, POSITION x)
        /* Blind players see nothing */
        if (p_ptr->blind) return FALSE;
 
-       /* Access the cave grid */
        c_ptr = &cave[y][x];
 
        /* Note that "torch-lite" yields "illumination" */
@@ -956,7 +955,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap,
        feature_type *f_ptr = &f_info[feat];
 
        TERM_COLOR a;
-       byte c;
+       SYMBOL_CODE c;
 
        /* Boring grids (floors, etc) */
        if (!have_flag(f_ptr->flags, FF_REMEMBER))
@@ -1506,14 +1505,12 @@ void note_spot(POSITION y, POSITION x)
                        if (view_torch_grids &&
                            ((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) || p_ptr->see_nocto))
                        {
-                               /* Memorize */
                                c_ptr->info |= (CAVE_MARK);
                        }
 
                        /* Option -- memorize all perma-lit floors */
                        else if (view_perma_grids && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW))
                        {
-                               /* Memorize */
                                c_ptr->info |= (CAVE_MARK);
                        }
                }
@@ -1521,28 +1518,24 @@ void note_spot(POSITION y, POSITION x)
                /* Memorize normal grids */
                else if (have_flag(f_ptr->flags, FF_LOS))
                {
-                       /* Memorize */
                        c_ptr->info |= (CAVE_MARK);
                }
 
                /* Memorize torch-lit walls */
                else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT))
                {
-                       /* Memorize */
                        c_ptr->info |= (CAVE_MARK);
                }
 
                /* Memorize walls seen by noctovision of Ninja */
                else if (p_ptr->see_nocto)
                {
-                       /* Memorize */
                        c_ptr->info |= (CAVE_MARK);
                }
 
                /* Memorize certain non-torch-lit wall grids */
                else if (check_local_illumination(y, x))
                {
-                       /* Memorize */
                        c_ptr->info |= (CAVE_MARK);
                }
        }
@@ -2183,7 +2176,6 @@ void do_cmd_view_map(void)
 
        screen_save();
 
-       /* Note */
        prt(_("お待ち下さい...", "Please wait..."), 0, 0);
 
        Term_fresh();
@@ -5130,3 +5122,14 @@ bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode)
 
        return TRUE;
 }
+
+/*!
+ * @brief 地形は開くものであって、かつ開かれているかを返す /
+ * Attempt to open the given chest at the given location
+ * @param feat 地形ID
+ * @return 開いた地形である場合TRUEを返す /  Return TRUE if the given feature is an open door
+ */
+bool is_open(FEAT_IDX feat)
+{
+       return have_flag(f_info[feat].flags, FF_CLOSE) && (feat != feat_state(feat, FF_CLOSE));
+}