OSDN Git Service

[Refactor] #38997 update_gambling_monsters() にplayer_type * 引数を追加 / Added player_type...
authorHourier <hourier@users.sourceforge.jp>
Sat, 11 Jan 2020 10:20:49 +0000 (19:20 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 11 Jan 2020 10:20:49 +0000 (19:20 +0900)
src/birth.c
src/bldg.c
src/bldg.h
src/core.c
src/load.c
src/wizard2.c

index 134eb91..9eed176 100644 (file)
@@ -1840,6 +1840,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
                creature_ptr->mane_spell[i] = -1;
                creature_ptr->mane_dam[i] = 0;
        }
+
        creature_ptr->mane_num = 0;
        creature_ptr->exit_bldg = TRUE; /* only used for arena now -KMW- */
 
@@ -1847,7 +1848,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
        creature_ptr->today_mon = 0;
 
        /* Reset monster arena */
-       update_gambling_monsters();
+       update_gambling_monsters(creature_ptr);
 
        /* Reset mutations */
        creature_ptr->muta1 = 0;
index b33d35c..1b81b07 100644 (file)
@@ -1487,14 +1487,14 @@ static bool gamble_comm(player_type *player_ptr, int cmd)
  * @param player_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
-void update_gambling_monsters(void)
+void update_gambling_monsters(player_type *player_ptr)
 {
        int total, i;
        int max_dl = 0;
        int mon_level;
        int power[4];
        bool tekitou;
-       bool old_inside_battle = p_ptr->phase_out;
+       bool old_inside_battle = player_ptr->phase_out;
 
        for (i = 0; i < current_world_ptr->max_d_idx; i++)
                if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
@@ -1522,9 +1522,9 @@ void update_gambling_monsters(void)
                        while (1)
                        {
                                get_mon_num_prep(monster_can_entry_arena, NULL);
-                               p_ptr->phase_out = TRUE;
+                               player_ptr->phase_out = TRUE;
                                r_idx = get_mon_num(mon_level);
-                               p_ptr->phase_out = old_inside_battle;
+                               player_ptr->phase_out = old_inside_battle;
                                if (!r_idx) continue;
 
                                if ((r_info[r_idx].flags1 & RF1_UNIQUE) || (r_info[r_idx].flags7 & RF7_UNIQUE2))
@@ -1600,7 +1600,7 @@ static bool kakutoujou(player_type *player_ptr)
 
        if ((current_world_ptr->game_turn - current_world_ptr->arena_start_turn) > TURNS_PER_TICK * 250)
        {
-               update_gambling_monsters();
+               update_gambling_monsters(player_ptr);
                current_world_ptr->arena_start_turn = current_world_ptr->game_turn;
        }
 
index 8178ab9..6bdf108 100644 (file)
@@ -117,7 +117,7 @@ extern PRICE kakekin;
 extern int sel_monster;
 
 extern const arena_type arena_info[MAX_ARENA_MONS + 2];
-extern void update_gambling_monsters(void);
+extern void update_gambling_monsters(player_type *player_ptr);
 extern void do_cmd_bldg(player_type *player_ptr);
 
 extern void clear_bldg(int min_row, int max_row);
index b016de4..3018a60 100644 (file)
@@ -3147,7 +3147,7 @@ static void process_world(player_type *player_ptr)
                        msg_print(_("相打ちに終わりました。", "They have kill each other at the same time."));
                        msg_print(NULL);
                        player_ptr->energy_need = 0;
-                       update_gambling_monsters();
+                       update_gambling_monsters(player_ptr);
                }
                else if ((number_mon-1) == 0)
                {
@@ -3172,7 +3172,7 @@ static void process_world(player_type *player_ptr)
                        }
                        msg_print(NULL);
                        player_ptr->energy_need = 0;
-                       update_gambling_monsters();
+                       update_gambling_monsters(player_ptr);
                }
                else if (current_world_ptr->game_turn - player_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
                {
@@ -3180,7 +3180,7 @@ static void process_world(player_type *player_ptr)
                        player_ptr->au += kakekin;
                        msg_print(NULL);
                        player_ptr->energy_need = 0;
-                       update_gambling_monsters();
+                       update_gambling_monsters(player_ptr);
                }
        }
 
@@ -4999,7 +4999,7 @@ static void dungeon(player_type *player_ptr, bool load_game)
                if (load_game)
                {
                        player_ptr->energy_need = 0;
-                       update_gambling_monsters();
+                       update_gambling_monsters(player_ptr);
                }
                else
                {
index a2e571e..654a45e 100644 (file)
@@ -1934,7 +1934,7 @@ static void rd_extra(player_type *creature_ptr)
 
        if (z_older_than(10, 0, 3))
        {
-               update_gambling_monsters();
+               update_gambling_monsters(creature_ptr);
        }
        else
        {
index f1fdf4e..d08fdf8 100644 (file)
@@ -1753,7 +1753,7 @@ void do_cmd_debug(player_type *creature_ptr)
                break;
 
        case 'B':
-               update_gambling_monsters();
+               update_gambling_monsters(creature_ptr);
                break;
 
                /* Create any object */