OSDN Git Service

[Refactor] #38997 get_max_stats() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Tue, 2 Jul 2019 14:49:57 +0000 (23:49 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 2 Jul 2019 14:49:57 +0000 (23:49 +0900)
src/birth.c
src/birth.h
src/cmd-quaff.c
src/player-effects.c

index a732d24..6bf1757 100644 (file)
@@ -1152,7 +1152,7 @@ static void get_stats(void)
  * @brief プレイヤーの限界ステータスを決める。
  * @return なし
  */
-void get_max_stats(void)
+void get_max_stats(player_type *creature_ptr)
 {
        int i, j;
        int dice[6];
@@ -1180,14 +1180,14 @@ void get_max_stats(void)
                BASE_STATUS max_max = 18 + 60 + dice[i]*10;
 
                /* Save that value */
-               p_ptr->stat_max_max[i] = max_max;
-               if (p_ptr->stat_max[i] > max_max)
-                       p_ptr->stat_max[i] = max_max;
-               if (p_ptr->stat_cur[i] > max_max)
-                       p_ptr->stat_cur[i] = max_max;
+               creature_ptr->stat_max_max[i] = max_max;
+               if (creature_ptr->stat_max[i] > max_max)
+                       creature_ptr->stat_max[i] = max_max;
+               if (creature_ptr->stat_cur[i] > max_max)
+                       creature_ptr->stat_cur[i] = max_max;
        }
-       p_ptr->knowledge &= ~(KNOW_STAT);
-       p_ptr->redraw |= (PR_STATS);
+       creature_ptr->knowledge &= ~(KNOW_STAT);
+       creature_ptr->redraw |= (PR_STATS);
 }
 
 
@@ -4464,7 +4464,7 @@ static bool player_birth_aux(void)
 
        /*** Finish up ***/
 
-       get_max_stats();
+       get_max_stats(p_ptr);
 
        get_virtues(p_ptr);
 
index f24a8ea..02455df 100644 (file)
@@ -39,7 +39,7 @@ extern birther previous_char;
 /* birth.c */
 extern void add_history_from_pref_line(concptr t);
 extern void player_birth(player_type *creature_ptr);
-extern void get_max_stats(void);
+extern void get_max_stats(player_type *creature_ptr);
 extern void get_height_weight(void);
 extern void player_outfit(void);
 extern void dump_yourself(FILE *fff);
index 8ae3a10..06f0324 100644 (file)
@@ -468,7 +468,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
 
                case SV_POTION_NEW_LIFE:
                        roll_hitdice(p_ptr, 0L);
-                       get_max_stats();
+                       get_max_stats(p_ptr);
                        p_ptr->update |= PU_BONUS;
                        lose_all_mutations(p_ptr);
                        ident = TRUE;
index 84f970a..b1d5a1e 100644 (file)
@@ -3879,7 +3879,7 @@ void do_poly_self(player_type *creature_ptr)
        {
                power -= 10;
 
-               get_max_stats();
+               get_max_stats(p_ptr);
                roll_hitdice(creature_ptr, 0L);
        }