• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision0b0ae8380ba82f827e685387b885a16abc5af171 (tree)
Time2019-07-03 23:58:51
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 get_history() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -1248,7 +1248,7 @@ static void get_extra(player_type *creature_ptr, bool roll_hitdie)
12481248 * @brief プレイヤーの生い立ちの自動生成を行う。 / Get the racial history, and social class, using the "history charts".
12491249 * @return なし
12501250 */
1251-static void get_history(void)
1251+static void get_history(player_type *creature_ptr)
12521252 {
12531253 int i, n, chart, roll, social_class;
12541254
@@ -1257,7 +1257,7 @@ static void get_history(void)
12571257 char buf[240];
12581258
12591259 /* Clear the previous history strings */
1260- for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
1260+ for (i = 0; i < 4; i++) creature_ptr->history[i][0] = '\0';
12611261
12621262 /* Clear the history text */
12631263 buf[0] = '\0';
@@ -1266,7 +1266,7 @@ static void get_history(void)
12661266 social_class = randint1(4);
12671267
12681268 /* Starting place */
1269- switch (p_ptr->prace)
1269+ switch (creature_ptr->prace)
12701270 {
12711271 case RACE_AMBERITE:
12721272 {
@@ -1479,7 +1479,7 @@ static void get_history(void)
14791479 else if (social_class < 1) social_class = 1;
14801480
14811481 /* Save the social class */
1482- p_ptr->sc = (s16b)social_class;
1482+ creature_ptr->sc = (s16b)social_class;
14831483
14841484
14851485 /* Skip leading spaces */
@@ -1498,7 +1498,7 @@ static void get_history(void)
14981498 t = temp;
14991499 for(i=0 ; i<4 ; i++){
15001500 if(t[0]==0)break;
1501- else {strcpy(p_ptr->history[i], t);t += strlen(t)+1;}
1501+ else {strcpy(creature_ptr->history[i], t);t += strlen(t)+1;}
15021502 }
15031503 }
15041504 }
@@ -4199,7 +4199,7 @@ static bool player_birth_aux(void)
41994199 get_ahw();
42004200
42014201 /* Roll for social class */
4202- get_history();
4202+ get_history(p_ptr);
42034203 }
42044204
42054205 /* Feedback */
@@ -4300,7 +4300,7 @@ static bool player_birth_aux(void)
43004300 get_ahw();
43014301
43024302 /* Roll for social class */
4303- get_history();
4303+ get_history(p_ptr);
43044304
43054305 if (autochara)
43064306 {
@@ -4342,7 +4342,7 @@ static bool player_birth_aux(void)
43424342 get_ahw();
43434343
43444344 /* Roll for social class */
4345- get_history();
4345+ get_history(p_ptr);
43464346
43474347 break;
43484348 }
Show on old repository browser