From e7a0e355f9d64f34fc28680efb73c83dbc19fb6f Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 19 May 2020 17:06:17 +0900 Subject: [PATCH] [Refactor] #40392 Reshaped player_birth_wizard() --- src/birth/birth-wizard.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/birth/birth-wizard.c b/src/birth/birth-wizard.c index 596db12bf..3958af41a 100644 --- a/src/birth/birth-wizard.c +++ b/src/birth/birth-wizard.c @@ -142,10 +142,9 @@ static bool get_player_sex(player_type *creature_ptr, char *buf) bool player_birth_wizard(player_type *creature_ptr, void (*process_autopick_file_command)(char *)) { display_initial_birth_message(creature_ptr); - int n; const char p2 = ')'; char buf[80]; - for (n = 0; n < MAX_SEXES; n++) { + for (int n = 0; n < MAX_SEXES; n++) { sp_ptr = &sex_info[n]; sprintf(buf, _("%c%c%s", "%c%c %s"), I2A(n), p2, sp_ptr->title); put_str(buf, 12 + (n / 5), 2 + 15 * (n % 5)); @@ -158,13 +157,12 @@ bool player_birth_wizard(player_type *creature_ptr, void (*process_autopick_file creature_ptr->prace = 0; while (TRUE) { char temp[80 * 10]; - concptr t; if (!get_player_race(creature_ptr)) return FALSE; clear_from(10); roff_to_buf(race_explanations[creature_ptr->prace], 74, temp, sizeof(temp)); - t = temp; + concptr t = temp; for (int i = 0; i < 10; i++) { if (t[0] == 0) break; @@ -184,13 +182,12 @@ bool player_birth_wizard(player_type *creature_ptr, void (*process_autopick_file creature_ptr->pclass = 0; while (TRUE) { char temp[80 * 9]; - concptr t; if (!get_player_class(creature_ptr)) return FALSE; clear_from(10); roff_to_buf(class_explanations[creature_ptr->pclass], 74, temp, sizeof(temp)); - t = temp; + concptr t = temp; for (int i = 0; i < 9; i++) { if (t[0] == 0) break; @@ -212,13 +209,12 @@ bool player_birth_wizard(player_type *creature_ptr, void (*process_autopick_file creature_ptr->pseikaku = 0; while (TRUE) { char temp[80 * 8]; - concptr t; if (!get_player_personality(creature_ptr)) return FALSE; clear_from(10); roff_to_buf(personality_explanations[creature_ptr->pseikaku], 74, temp, sizeof(temp)); - t = temp; + concptr t = temp; for (int i = 0; i < A_MAX; i++) { if (t[0] == 0) break; -- 2.11.0