OSDN Git Service

[Refactor] #38997 calc_score() に player_type * 引数を追加.
[hengband/hengband.git] / src / scores.c
index a1edf22..5104cc2 100644 (file)
@@ -407,8 +407,6 @@ void display_scores_aux(int from, int to, int note, high_score *score)
 void display_scores(int from, int to)
 {
        char buf[1024];
-
-       /* Build the filename */
        path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
 
        /* Open the binary high score file, for reading */
@@ -496,7 +494,7 @@ errr top_twenty(void)
                FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
 
        /* Calculate and save the points */
-       sprintf(the_score.pts, "%9ld", (long)calc_score());
+       sprintf(the_score.pts, "%9ld", (long)calc_score(p_ptr));
        the_score.pts[9] = '\0';
 
        /* Save the current gold */
@@ -521,7 +519,7 @@ errr top_twenty(void)
        sprintf(the_score.who, "%-.15s", p_ptr->name);
 
        /* Save the player info */
-       sprintf(the_score.uid, "%7u", player_uid);
+       sprintf(the_score.uid, "%7u", p_ptr->player_uid);
        sprintf(the_score.sex, "%c", (p_ptr->psex ? 'm' : 'f'));
        sprintf(the_score.p_r, "%2d", MIN(p_ptr->prace, MAX_RACES));
        sprintf(the_score.p_c, "%2d", MIN(p_ptr->pclass, MAX_CLASS));
@@ -619,7 +617,7 @@ errr predict_score(void)
                FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
 
        /* Calculate and save the points */
-       sprintf(the_score.pts, "%9ld", (long)calc_score());
+       sprintf(the_score.pts, "%9ld", (long)calc_score(p_ptr));
 
        /* Save the current gold */
        sprintf(the_score.gold, "%9lu", (long)p_ptr->au);
@@ -634,7 +632,7 @@ errr predict_score(void)
        sprintf(the_score.who, "%-.15s", p_ptr->name);
 
        /* Save the player info */
-       sprintf(the_score.uid, "%7u", player_uid);
+       sprintf(the_score.uid, "%7u", p_ptr->player_uid);
        sprintf(the_score.sex, "%c", (p_ptr->psex ? 'm' : 'f'));
        sprintf(the_score.p_r, "%2d", MIN(p_ptr->prace, MAX_RACES));
        sprintf(the_score.p_c, "%2d", MIN(p_ptr->pclass, MAX_CLASS));
@@ -688,8 +686,6 @@ void show_highclass(void)
        char buf[1024], out_val[256];
 
        screen_save();
-
-       /* Build the filename */
        path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
 
        highscore_fd = fd_open(buf, O_RDONLY);
@@ -769,8 +765,6 @@ void race_score(int race_num)
        sprintf(tmp_str,_("最高の%s", "The Greatest of all the %s"), race_info[race_num].title);
 
        prt(tmp_str, 5, 15);
-
-       /* Build the filename */
        path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
 
        highscore_fd = fd_open(buf, O_RDONLY);