OSDN Git Service

[Refactor] #38997 place_quest_monsters() に player_type * 引数を追加. / Add player_type...
authordeskull <deskull@users.sourceforge.jp>
Sun, 10 Nov 2019 23:38:02 +0000 (08:38 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 10 Nov 2019 23:38:02 +0000 (08:38 +0900)
src/floor-generate.c
src/floor-generate.h
src/floor-save.c

index d4b4c0b..4ff5323 100644 (file)
@@ -392,9 +392,11 @@ static void alloc_object(floor_type *floor_ptr, int set, EFFECT_ID typ, int num)
 
 /*!
  * @brief クエストに関わるモンスターの配置を行う / Place quest monsters
+ * @param floor_ptr 配置するフロアの参照ポインタ
+ * @param subject_ptr 近隣への即出現を避けるためのプレイヤークリーチャー参照ポインタ
  * @return 成功したならばTRUEを返す
  */
-bool place_quest_monsters(floor_type *floor_ptr)
+bool place_quest_monsters(floor_type *floor_ptr, player_type *creature_ptr)
 {
        int i;
 
@@ -409,7 +411,7 @@ bool place_quest_monsters(floor_type *floor_ptr)
                    (quest[i].type != QUEST_TYPE_KILL_LEVEL &&
                     quest[i].type != QUEST_TYPE_RANDOM) ||
                    quest[i].level != floor_ptr->dun_level ||
-                   p_ptr->dungeon_idx != quest[i].dungeon ||
+                   creature_ptr->dungeon_idx != quest[i].dungeon ||
                    (quest[i].flags & QUEST_FLAG_PRESET))
                {
                        /* Ignore it */
@@ -450,7 +452,7 @@ bool place_quest_monsters(floor_type *floor_ptr)
 
                                        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
                                        if (!monster_can_enter(y, x, r_ptr, 0)) continue;
-                                       if (distance(y, x, p_ptr->y, p_ptr->x) < 10) continue;
+                                       if (distance(y, x, creature_ptr->y, creature_ptr->x) < 10) continue;
                                        if (g_ptr->info & CAVE_ICKY) continue;
                                        else break;
                                }
@@ -915,7 +917,7 @@ static bool cave_gen(floor_type *floor_ptr)
        /* Determine the character location */
        if (!new_player_spot()) return FALSE;
 
-       if (!place_quest_monsters(floor_ptr)) return FALSE;
+       if (!place_quest_monsters(floor_ptr, p_ptr)) return FALSE;
 
        /* Basic "amount" */
        k = (floor_ptr->dun_level / 3);
index 512868c..99b802c 100644 (file)
@@ -100,7 +100,7 @@ struct dun_data
 
 extern dun_data *dun;
 
-extern bool place_quest_monsters(floor_type *floor_ptr);
+extern bool place_quest_monsters(floor_type *floor_ptr, player_type *creature_ptr);
 extern void wipe_generate_random_floor_flags(floor_type *floor_ptr);
 extern void clear_cave(floor_type *floor_ptr);
 extern void generate_floor(floor_type *floor_ptr);
index fe3c2fd..e6a106e 100644 (file)
@@ -1270,7 +1270,7 @@ void change_floor(player_type *creature_ptr)
                                }
                        }
 
-                       (void)place_quest_monsters(creature_ptr->current_floor_ptr);
+                       (void)place_quest_monsters(creature_ptr->current_floor_ptr, creature_ptr);
 
                        /* Place some random monsters */
                        alloc_times = absence_ticks / alloc_chance;