OSDN Git Service

[Refactor] #38852 いくつかの do_cmd_*() をリファクタリング。 / Refactor some do_cmd_*().
[hengband/hengband.git] / src / save.c
index ce7c4fb..bf1b59c 100644 (file)
@@ -556,9 +556,9 @@ static void save_quick_start(void)
        int i;
 
        wr_byte(previous_char.psex);
-       wr_byte(previous_char.prace);
-       wr_byte(previous_char.pclass);
-       wr_byte(previous_char.pseikaku);
+       wr_byte((byte_hack)previous_char.prace);
+       wr_byte((byte_hack)previous_char.pclass);
+       wr_byte((byte_hack)previous_char.pseikaku);
        wr_byte((byte_hack)previous_char.realm1);
        wr_byte((byte_hack)previous_char.realm2);
 
@@ -599,9 +599,7 @@ static void wr_extra(void)
        byte tmp8u;
 
        wr_string(p_ptr->name);
-
        wr_string(p_ptr->died_from);
-
        wr_string(p_ptr->last_message ? p_ptr->last_message : "");
 
        save_quick_start();
@@ -612,10 +610,10 @@ static void wr_extra(void)
        }
 
        /* Race/Class/Gender/Spells */
-       wr_byte(p_ptr->prace);
-       wr_byte(p_ptr->pclass);
-       wr_byte(p_ptr->pseikaku);
-       wr_byte(p_ptr->psex);
+       wr_byte((byte_hack)p_ptr->prace);
+       wr_byte((byte_hack)p_ptr->pclass);
+       wr_byte((byte_hack)p_ptr->pseikaku);
+       wr_byte((byte_hack)p_ptr->psex);
        wr_byte((byte_hack)p_ptr->realm1);
        wr_byte((byte_hack)p_ptr->realm2);
        wr_byte(0);
@@ -649,7 +647,7 @@ static void wr_extra(void)
        for (i = 0; i < 108; i++) wr_s32b(p_ptr->magic_num1[i]);
        for (i = 0; i < 108; i++) wr_byte(p_ptr->magic_num2[i]);
 
-       wr_byte(p_ptr->start_race);
+       wr_byte((byte_hack)p_ptr->start_race);
        wr_s32b(p_ptr->old_race1);
        wr_s32b(p_ptr->old_race2);
        wr_s16b(p_ptr->old_realm);
@@ -1151,20 +1149,14 @@ static bool wr_dungeon(void)
        saved_floor_type *cur_sf_ptr;
        int i;
 
-       /* Forget the lite */
        forget_lite();
-
-       /* Forget the view */
        forget_view();
-
-       /* Forget the view */
        clear_mon_lite();
 
        /* Update lite/view */
        p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
        p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
 
-
        /*** Meta info ***/
 
        /* Number of floor_id used from birth */
@@ -1824,7 +1816,6 @@ bool load_player(void)
                /* Oops, lock exists */
                if (fkk)
                {
-                       /* Close the file */
                        my_fclose(fkk);
 
                        msg_print(_("セーブファイルは現在使用中です。", "Savefile is currently in use."));
@@ -1872,8 +1863,6 @@ bool load_player(void)
 
                /* What */
                if (err) what = _("セーブファイルを読めません。", "Cannot read savefile");
-
-               /* Close the file */
                (void)fd_close(fd);
        }
 
@@ -1887,8 +1876,6 @@ bool load_player(void)
                z_patch = vvv[2];
                sf_extra = vvv[3];
 
-
-               /* Clear screen */
                Term_clear();
 
                /* Attempt to load */
@@ -1937,13 +1924,8 @@ bool load_player(void)
                        }
                        else
                        {
-#ifdef JP
-                               msg_format("バージョン %d.%d.%d 用のセーブ・ファイルを変換しました。",
+                               msg_format(_("バージョン %d.%d.%d 用のセーブ・ファイルを変換しました。", "Converted a %d.%d.%d savefile."),
                                    (z_major > 9) ? z_major-10 : z_major , z_minor, z_patch);
-#else
-                               msg_format("Converted a %d.%d.%d savefile.",
-                                   (z_major > 9) ? z_major-10 : z_major , z_minor, z_patch);
-#endif
                        }
                        msg_print(NULL);
                }
@@ -1956,7 +1938,6 @@ bool load_player(void)
                        {
                                /* A character was loaded */
                                character_loaded = TRUE;
-
                                return (TRUE);
                        }
 
@@ -2003,14 +1984,9 @@ bool load_player(void)
 
 #endif
 
+       msg_format(_("エラー(%s)がバージョン%d.%d.%d 用セーブファイル読み込み中に発生。", "Error (%s) reading %d.%d.%d savefile."),
+               what, (z_major>9) ? z_major - 10 : z_major, z_minor, z_patch);
 
-#ifdef JP
-       msg_format("エラー(%s)がバージョン%d.%d.%d 用セーブファイル読み込み中に発生。",
-                  what, (z_major>9) ? z_major - 10 : z_major, z_minor, z_patch);
-#else
-       msg_format("Error (%s) reading %d.%d.%d savefile.",
-                  what, (z_major>9) ? z_major - 10 : z_major, z_minor, z_patch);
-#endif
        msg_print(NULL);
 
        return (FALSE);