OSDN Git Service

[Refactor] #38997 get_project_point() に floor_type * 引数を追加. / Add floor_type * argume...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 08:02:05 +0000 (17:02 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 08:02:05 +0000 (17:02 +0900)
src/monster-spell.h
src/mspells1.c
src/mspells2.c

index 5053bee..59a5ae7 100644 (file)
@@ -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 */
index fa8672a..1acf57f 100644 (file)
@@ -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;
index d525361..77d085d 100644 (file)
@@ -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);
                        }