OSDN Git Service

update_mon_lite()内でモンスター光源フラグを立てる際に, 外壁の永久岩を
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 6 Jul 2003 20:47:44 +0000 (20:47 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 6 Jul 2003 20:47:44 +0000 (20:47 +0000)
超えそうな場合はcave_floor_bold()で偽になりそれから先は処理されない.
また, モンスターは常に(1, 1)から(cur_hgt - 2, cur_wid - 2)の範囲内に
いる. このことから, cave[][]の配列外アクセスは起きないので,
mon_*_hack()内のin_bounds2()は常に真になる. このパラノイアコードを一
旦コメントアウトすることで比較回数を削り, わずかに高速化を図った.

src/cave.c

index 5674c83..dddbf11 100644 (file)
@@ -3196,8 +3196,8 @@ static void mon_lite_hack(int y, int x)
        cave_type *c_ptr;
        int       midpoint, dpf, d;
 
-       /* Out of bounds */
-       if (!in_bounds2(y, x)) return;
+       /* We trust this grid is in bounds */
+       /* if (!in_bounds2(y, x)) return; */
 
        c_ptr = &cave[y][x];
 
@@ -3279,8 +3279,8 @@ static void mon_dark_hack(int y, int x)
        cave_type *c_ptr;
        int       midpoint, dpf, d;
 
-       /* Out of bounds */
-       if (!in_bounds2(y, x)) return;
+       /* We trust this grid is in bounds */
+       /* if (!in_bounds2(y, x)) return; */
 
        c_ptr = &cave[y][x];