OSDN Git Service

部屋を暗くする処理で場合によってはまだ配列外アクセスを起こす可能性の
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 8 Dec 2003 02:10:00 +0000 (02:10 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 8 Dec 2003 02:10:00 +0000 (02:10 +0000)
あった部分を修正. また, GLOW地形かどうかは外見で判定するように変更.

src/spells1.c
src/spells2.c

index dfddbb3..8a7b96b 100644 (file)
@@ -1075,10 +1075,15 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                        int by = y + ddy_ddd[j];
                                        int bx = x + ddx_ddd[j];
 
-                                       if (in_bounds2(by, bx) && have_flag(f_flags_bold(by, bx), FF_GLOW))
+                                       if (in_bounds2(by, bx))
                                        {
-                                               do_dark = FALSE;
-                                               break;
+                                               cave_type *cc_ptr = &cave[by][bx];
+
+                                               if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
+                                               {
+                                                       do_dark = FALSE;
+                                                       break;
+                                               }
                                        }
                                }
 
index 18b5e49..6a9d818 100644 (file)
@@ -6103,10 +6103,18 @@ static void cave_temp_room_unlite(void)
                {
                        for (j = 0; j < 9; j++)
                        {
-                               if (have_flag(f_flags_bold(y + ddy_ddd[j], x + ddx_ddd[j]), FF_GLOW))
+                               int by = y + ddy_ddd[j];
+                               int bx = x + ddx_ddd[j];
+
+                               if (in_bounds2(by, bx))
                                {
-                                       do_dark = FALSE;
-                                       break;
+                                       cave_type *cc_ptr = &cave[by][bx];
+
+                                       if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
+                                       {
+                                               do_dark = FALSE;
+                                               break;
+                                       }
                                }
                        }