• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision68f46633bf3fa10c1e6002442348023b86b4a3a0 (tree)
Time2019-05-14 21:06:45
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38995 player_base を player_type の base_name へ改名して移動.

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -767,7 +767,7 @@ static concptr pickpref_filename(int filename_mode)
767767 return format("%s.prf", namebase);
768768
769769 case PT_WITH_PNAME:
770- return format("%s-%s.prf", namebase, player_base);
770+ return format("%s-%s.prf", namebase, p_ptr->base_name);
771771
772772 default:
773773 return NULL;
--- a/src/birth.c
+++ b/src/birth.c
@@ -3560,9 +3560,9 @@ static bool do_cmd_histpref(void)
35603560 histpref_buf = histbuf;
35613561
35623562 #ifdef JP
3563- sprintf(buf, "histedit-%s.prf", player_base);
3563+ sprintf(buf, "histedit-%s.prf", p_ptr->base_name);
35643564 #else
3565- sprintf(buf, "histpref-%s.prf", player_base);
3565+ sprintf(buf, "histpref-%s.prf", p_ptr->base_name);
35663566 #endif
35673567 err = process_histpref_file(buf);
35683568
--- a/src/chuukei.c
+++ b/src/chuukei.c
@@ -662,7 +662,7 @@ void prepare_movie_hooks(void)
662662 }
663663 else
664664 {
665- sprintf(tmp, "%s.amv", player_base);
665+ sprintf(tmp, "%s.amv", p_ptr->base_name);
666666 if (get_string(_("ムービー記録ファイル: ", "Movie file name: "), tmp, 80))
667667 {
668668 int fd;
--- a/src/cmd-dump.c
+++ b/src/cmd-dump.c
@@ -1091,7 +1091,7 @@ void do_cmd_change_name(void)
10911091 /* File dump */
10921092 else if (c == 'f')
10931093 {
1094- sprintf(tmp, "%s.txt", player_base);
1094+ sprintf(tmp, "%s.txt", p_ptr->base_name);
10951095 if (get_string(_("ファイル名: ", "File name: "), tmp, 80))
10961096 {
10971097 if (tmp[0] && (tmp[0] != ' '))
@@ -2624,7 +2624,7 @@ void do_cmd_macros(void)
26242624 prt(_("ファイル: ", "File: "), 18, 0);
26252625
26262626 /* Default filename */
2627- sprintf(tmp, "%s.prf", player_base);
2627+ sprintf(tmp, "%s.prf", p_ptr->base_name);
26282628
26292629 /* Ask for a file */
26302630 if (!askfor(tmp, 80)) continue;
@@ -2658,7 +2658,7 @@ void do_cmd_macros(void)
26582658 prt(_("ファイル: ", "File: "), 18, 0);
26592659
26602660 /* Default filename */
2661- sprintf(tmp, "%s.prf", player_base);
2661+ sprintf(tmp, "%s.prf", p_ptr->base_name);
26622662
26632663 /* Ask for a file */
26642664 if (!askfor(tmp, 80)) continue;
@@ -2780,7 +2780,7 @@ void do_cmd_macros(void)
27802780 prt(_("ファイル: ", "File: "), 18, 0);
27812781
27822782 /* Default filename */
2783- sprintf(tmp, "%s.prf", player_base);
2783+ sprintf(tmp, "%s.prf", p_ptr->base_name);
27842784
27852785 /* Ask for a file */
27862786 if (!askfor(tmp, 80)) continue;
@@ -3058,7 +3058,7 @@ void do_cmd_visuals(void)
30583058 prt(_("ファイル: ", "File: "), 17, 0);
30593059
30603060 /* Default filename */
3061- sprintf(tmp, "%s.prf", player_base);
3061+ sprintf(tmp, "%s.prf", p_ptr->base_name);
30623062
30633063 /* Query */
30643064 if (!askfor(tmp, 70)) continue;
@@ -3083,7 +3083,7 @@ void do_cmd_visuals(void)
30833083 prt(_("ファイル: ", "File: "), 17, 0);
30843084
30853085 /* Default filename */
3086- sprintf(tmp, "%s.prf", player_base);
3086+ sprintf(tmp, "%s.prf", p_ptr->base_name);
30873087
30883088 /* Get a filename */
30893089 if (!askfor(tmp, 70)) continue;
@@ -3134,7 +3134,7 @@ void do_cmd_visuals(void)
31343134 prt(_("ファイル: ", "File: "), 17, 0);
31353135
31363136 /* Default filename */
3137- sprintf(tmp, "%s.prf", player_base);
3137+ sprintf(tmp, "%s.prf", p_ptr->base_name);
31383138
31393139 /* Get a filename */
31403140 if (!askfor(tmp, 70)) continue;
@@ -3201,7 +3201,7 @@ void do_cmd_visuals(void)
32013201 prt(_("ファイル: ", "File: "), 17, 0);
32023202
32033203 /* Default filename */
3204- sprintf(tmp, "%s.prf", player_base);
3204+ sprintf(tmp, "%s.prf", p_ptr->base_name);
32053205
32063206 /* Get a filename */
32073207 if (!askfor(tmp, 70)) continue;
@@ -3628,7 +3628,7 @@ void do_cmd_colors(void)
36283628 prt(_("ファイル: ", "File: "), 10, 0);
36293629
36303630 /* Default file */
3631- sprintf(tmp, "%s.prf", player_base);
3631+ sprintf(tmp, "%s.prf", p_ptr->base_name);
36323632
36333633 /* Query */
36343634 if (!askfor(tmp, 70)) continue;
@@ -3657,7 +3657,7 @@ void do_cmd_colors(void)
36573657 prt(_("ファイル: ", "File: "), 10, 0);
36583658
36593659 /* Default filename */
3660- sprintf(tmp, "%s.prf", player_base);
3660+ sprintf(tmp, "%s.prf", p_ptr->base_name);
36613661
36623662 /* Get a filename */
36633663 if (!askfor(tmp, 70)) continue;
--- a/src/core.c
+++ b/src/core.c
@@ -5209,7 +5209,7 @@ static void load_all_pref_files(void)
52095209 process_pref_file(buf);
52105210
52115211 /* Access the "character" pref file */
5212- sprintf(buf, "%s.prf", player_base);
5212+ sprintf(buf, "%s.prf", p_ptr->base_name);
52135213
52145214 /* Process that file */
52155215 process_pref_file(buf);
--- a/src/externs.h
+++ b/src/externs.h
@@ -84,7 +84,6 @@ extern POSITION target_row;
8484 extern int player_uid;
8585 extern int player_euid;
8686 extern int player_egid;
87-extern char player_base[32];
8887 extern char savefile[1024];
8988 extern char savefile_base[40];
9089 extern pos_list tmp_pos;
--- a/src/files.c
+++ b/src/files.c
@@ -5809,7 +5809,7 @@ void process_player_name(bool sf)
58095809 int i, k = 0;
58105810 char old_player_base[32] = "";
58115811
5812- if (current_world_ptr->character_generated) strcpy(old_player_base, player_base);
5812+ if (current_world_ptr->character_generated) strcpy(old_player_base, p_ptr->base_name);
58135813
58145814 /* Cannot be too long */
58155815 #if defined(MACINTOSH) || defined(ACORN)
@@ -5854,7 +5854,7 @@ void process_player_name(bool sf)
58545854 if (c == '.') c = '_';
58555855
58565856 /* Accept all the letters */
5857- player_base[k++] = c;
5857+ p_ptr->base_name[k++] = c;
58585858 }
58595859
58605860 #else
@@ -5871,35 +5871,35 @@ void process_player_name(bool sf)
58715871 /* Accept some letters */
58725872 #ifdef JP
58735873 if(iskanji(c)){
5874- if(k + 2 >= sizeof(player_base) || !p_ptr->name[i+1]) break;
5875- player_base[k++] = c;
5874+ if(k + 2 >= sizeof(p_ptr->base_name) || !p_ptr->name[i+1]) break;
5875+ p_ptr->base_name[k++] = c;
58765876 i++;
5877- player_base[k++] = p_ptr->name[i];
5877+ p_ptr->base_name[k++] = p_ptr->name[i];
58785878 }
58795879 #ifdef SJIS
5880- else if (iskana(c)) player_base[k++] = c;
5880+ else if (iskana(c)) p_ptr->base_name[k++] = c;
58815881 #endif
58825882 else
58835883 #endif
58845884 /* Convert path separator to underscore */
58855885 if (!strncmp(PATH_SEP, p_ptr->name+i, strlen(PATH_SEP))){
5886- player_base[k++] = '_';
5886+ p_ptr->base_name[k++] = '_';
58875887 i += strlen(PATH_SEP);
58885888 }
58895889 /* Convert some characters to underscore */
58905890 #if defined(WINDOWS)
5891- else if (my_strchr("\"*,/:;<>?\\|", c)) player_base[k++] = '_';
5891+ else if (my_strchr("\"*,/:;<>?\\|", c)) p_ptr->base_name[k++] = '_';
58925892 #endif
5893- else if (isprint(c)) player_base[k++] = c;
5893+ else if (isprint(c)) p_ptr->base_name[k++] = c;
58945894 }
58955895
58965896 #endif
58975897
58985898 /* Terminate */
5899- player_base[k] = '\0';
5899+ p_ptr->base_name[k] = '\0';
59005900
59015901 /* Require a "base" name */
5902- if (!player_base[0]) strcpy(player_base, "PLAYER");
5902+ if (!p_ptr->base_name[0]) strcpy(p_ptr->base_name, "PLAYER");
59035903
59045904
59055905 #ifdef SAVEFILE_MUTABLE
@@ -5931,14 +5931,14 @@ void process_player_name(bool sf)
59315931 {
59325932 char temp[128];
59335933
5934- strcpy(savefile_base, player_base);
5934+ strcpy(savefile_base, p_ptr->base_name);
59355935
59365936 #ifdef SAVEFILE_USE_UID
5937- /* Rename the savefile, using the player_uid and player_base */
5938- (void)sprintf(temp, "%d.%s", player_uid, player_base);
5937+ /* Rename the savefile, using the player_uid and p_ptr->base_name */
5938+ (void)sprintf(temp, "%d.%s", player_uid, p_ptr->base_name);
59395939 #else
5940- /* Rename the savefile, using the player_base */
5941- (void)sprintf(temp, "%s", player_base);
5940+ /* Rename the savefile, using the p_ptr->base_name */
5941+ (void)sprintf(temp, "%s", p_ptr->base_name);
59425942 #endif
59435943
59445944 /* Build the filename */
@@ -5948,7 +5948,7 @@ void process_player_name(bool sf)
59485948 /* Load an autopick preference file */
59495949 if (current_world_ptr->character_generated)
59505950 {
5951- if (!streq(old_player_base, player_base)) autopick_load_pref(FALSE);
5951+ if (!streq(old_player_base, p_ptr->base_name)) autopick_load_pref(FALSE);
59525952 }
59535953 }
59545954
--- a/src/object1.c
+++ b/src/object1.c
@@ -91,7 +91,7 @@ void reset_visuals(void)
9191 process_pref_file("graf.prf");
9292
9393 /* Access the "character" pref file */
94- sprintf(buf, "graf-%s.prf", player_base);
94+ sprintf(buf, "graf-%s.prf", p_ptr->base_name);
9595
9696 /* Process "graf-<playername>.prf" */
9797 process_pref_file(buf);
@@ -106,7 +106,7 @@ void reset_visuals(void)
106106 process_pref_file("font.prf");
107107
108108 /* Access the "character" pref file */
109- sprintf(buf, "font-%s.prf", player_base);
109+ sprintf(buf, "font-%s.prf", p_ptr->base_name);
110110
111111 /* Process "font-<playername>.prf" */
112112 process_pref_file(buf);
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -607,6 +607,8 @@ struct player_type
607607 POSITION y; /* Player location in dungeon */
608608 POSITION x; /* Player location in dungeon */
609609 GAME_TEXT name[32]; /*!< 現在のプレイヤー名 / Current player's character name */
610+ char base_name[32]; /*!< Stripped version of "player_name" */
611+
610612 };
611613
612614 extern concptr your_alignment(void);
--- a/src/variable.c
+++ b/src/variable.c
@@ -73,12 +73,6 @@ int player_euid;
7373 int player_egid;
7474
7575 /*
76- * Stripped version of "player_name"
77- */
78-char player_base[32];
79-
80-
81-/*
8276 * Buffer to hold the current savefile name
8377 * 'savefile' holds full path name. 'savefile_base' holds only base name.
8478 */
Show on old repository browser