OSDN Git Service

cave_clean_bold()の使用に関する変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 25 Nov 2003 05:22:38 +0000 (05:22 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 25 Nov 2003 05:22:38 +0000 (05:22 +0000)
* プレイヤー初期配置でcave_clean_bold()が使われていて, 地獄などのよう
  にFF_FLOOR地形が存在しないダンジョンでプレイヤーを配置できず無限
  ループに陥るバグを修正.
* アイテムを置けるかどうかを見ている部分ではDROPが無意味になってしま
  うので, FF_DROPの有無とオブジェクトの有無のみを見るマクロ
  cave_droppable_bold()を作り, それに変更.
* 浅い流れの地形が主になる地形では鏡使いが鏡を置くことができず, まる
  で戦えない場合が予想されるため, 鏡の設置にもcave_droppable_bold()
  を読むようにした. ただし, 木の上に鏡を作られないようにPROJECTを必要
  とした. 回避の彫像の設置にも暫定的に適用. 爆発のルーンはトラップな
  ので, FF_FLOORを読むcave_clean_bold()のままにした.

src/defines.h
src/grid.c
src/object2.c
src/spells3.c

index 13c0957..b917bfb 100644 (file)
 
 
 /*
+ * Determine if a "legal" grid is a "droppable" grid
+ *
+ * Line 1 -- forbid non-drops
+ * Line 2 -- forbid object terrains
+ * Line 3 -- forbid normal objects
+ */
+#define cave_droppable_bold(Y,X) \
+       (have_flag(f_flags_bold((Y), (X)), FF_DROP) && \
+        !(cave[Y][X].info & CAVE_OBJECT) && \
+        !(cave[Y][X].o_idx))
+
+
+/*
  * Determine if a "legal" grid is an "empty" floor grid
  *
  * Line 1 -- forbid non-placement grids
index 2437072..5e706fc 100644 (file)
@@ -36,8 +36,10 @@ bool new_player_spot(void)
                c_ptr = &cave[y][x];
 
                /* Must be a "naked" floor grid */
-               if (!cave_clean_bold(y, x) || c_ptr->m_idx) continue;
-               if (!in_bounds(y,x)) continue;
+               if (c_ptr->m_idx) continue;
+               if (!have_flag(f_flags_grid(c_ptr), FF_MOVE) && !have_flag(f_flags_grid(c_ptr), FF_CAN_FLY)) continue;
+               if (!player_can_enter(c_ptr->feat, 0)) continue;
+               if (!in_bounds(y, x)) continue;
 
                /* Refuse to start on anti-teleport grids */
                if (c_ptr->info & (CAVE_ICKY)) continue;
index 547d4ff..5f70238 100644 (file)
@@ -4711,7 +4711,7 @@ void place_object(int y, int x, u32b mode)
        if (!in_bounds(y, x)) return;
 
        /* Require clean floor space */
-       if (!cave_clean_bold(y, x)) return;
+       if (!cave_droppable_bold(y, x)) return;
 
 
        /* Get local object */
@@ -4828,7 +4828,7 @@ void place_gold(int y, int x)
        if (!in_bounds(y, x)) return;
 
        /* Require clean floor space */
-       if (!cave_clean_bold(y, x)) return;
+       if (!cave_droppable_bold(y, x)) return;
 
 
        /* Get local object */
@@ -5089,7 +5089,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
                bx = tx;
 
                /* Require floor space */
-               if (!cave_clean_bold(by, bx)) continue;
+               if (!cave_droppable_bold(by, bx)) continue;
 
                /* Okay */
                flag = TRUE;
index d5ed04c..c10ec3e 100644 (file)
@@ -1946,7 +1946,7 @@ void alter_reality(void)
 bool warding_glyph(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_droppable_bold(py, px) || !have_flag(f_flags_bold(py, px), FF_PROJECT))
        {
 #ifdef JP
 msg_print("¾²¾å¤Î¥¢¥¤¥Æ¥à¤¬¼öʸ¤òÄ·¤ÍÊÖ¤·¤¿¡£");
@@ -1973,7 +1973,7 @@ msg_print("
 bool warding_mirror(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_droppable_bold(py, px) || !have_flag(f_flags_bold(py, px), FF_PROJECT))
        {
 #ifdef JP
 msg_print("¾²¾å¤Î¥¢¥¤¥Æ¥à¤¬¼öʸ¤òÄ·¤ÍÊÖ¤·¤¿¡£");