From: nothere Date: Sun, 6 Jul 2003 20:47:44 +0000 (+0000) Subject: update_mon_lite()内でモンスター光源フラグを立てる際に, 外壁の永久岩を X-Git-Tag: v2.1.2~1295 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=ab87a4d329d12575a12f42707c5efc972ed9b93d;p=hengband%2Fhengband.git update_mon_lite()内でモンスター光源フラグを立てる際に, 外壁の永久岩を 超えそうな場合はcave_floor_bold()で偽になりそれから先は処理されない. また, モンスターは常に(1, 1)から(cur_hgt - 2, cur_wid - 2)の範囲内に いる. このことから, cave[][]の配列外アクセスは起きないので, mon_*_hack()内のin_bounds2()は常に真になる. このパラノイアコードを一 旦コメントアウトすることで比較回数を削り, わずかに高速化を図った. --- diff --git a/src/cave.c b/src/cave.c index 5674c834f..dddbf112c 100644 --- a/src/cave.c +++ b/src/cave.c @@ -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];