From 5feddbb77acc9c447c2ef0dfcd77ce4dcbc28d8b Mon Sep 17 00:00:00 2001 From: deskull Date: Sat, 4 Jan 2020 17:02:05 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20get=5Fproject=5Fpoint()=20?= =?utf8?q?=E3=81=AB=20floor=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E=20/=20Add=20floor=5Ftype=20*=20argum?= =?utf8?q?ent=20to=20get=5Fproject=5Fpoint().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/monster-spell.h | 2 +- src/mspells1.c | 2 +- src/mspells2.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/monster-spell.h b/src/monster-spell.h index 5053bee17..59a5ae775 100644 --- a/src/monster-spell.h +++ b/src/monster-spell.h @@ -317,7 +317,7 @@ extern void bolt(MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int d extern void breath(POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type); /* mspells2.c */ -extern void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg); +extern void get_project_point(floor_type *floor_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg); extern bool monst_spell_monst(MONSTER_IDX m_idx); /* mspells3.c */ diff --git a/src/mspells1.c b/src/mspells1.c index fa8672a3e..1acf57f87 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -1480,7 +1480,7 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr) else if ((f5 & RF5_BA_LITE) && (m_ptr->cdis <= MAX_RANGE)) { POSITION by = y, bx = x; - get_project_point(m_ptr->fy, m_ptr->fx, &by, &bx, 0L); + get_project_point(target_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, &by, &bx, 0L); if ((distance(by, bx, y, x) <= 3) && los(target_ptr->current_floor_ptr, by, bx, y, x) && one_in_(5)) { do_spell = DO_SPELL_BA_LITE; diff --git a/src/mspells2.c b/src/mspells2.c index d5253617a..77d085d7f 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -206,12 +206,12 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS * @param flg 判定のフラグ配列 * @return なし */ -void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg) +void get_project_point(floor_type *floor_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg) { u16b path_g[128]; int path_n, i; - path_n = project_path(p_ptr->current_floor_ptr, path_g, MAX_RANGE, sy, sx, *ty, *tx, flg); + path_n = project_path(floor_ptr, path_g, MAX_RANGE, sy, sx, *ty, *tx, flg); *ty = sy; *tx = sx; @@ -223,7 +223,7 @@ void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT sx = GRID_X(path_g[i]); /* Hack -- Balls explode before reaching walls */ - if (!cave_have_flag_bold(p_ptr->current_floor_ptr, sy, sx, FF_PROJECT)) break; + if (!cave_have_flag_bold(floor_ptr, sy, sx, FF_PROJECT)) break; *ty = sy; *tx = sx; @@ -489,7 +489,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx) POSITION real_y = y; POSITION real_x = x; - get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L); + get_project_point(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L); if (projectable(p_ptr->current_floor_ptr, real_y, real_x, p_ptr->y, p_ptr->x)) { @@ -520,7 +520,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx) POSITION real_y = y; POSITION real_x = x; - get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP); + get_project_point(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP); if (projectable(p_ptr->current_floor_ptr, real_y, real_x, p_ptr->y, p_ptr->x) && (distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 2)) f4 &= ~(RF4_ROCKET); } -- 2.11.0