From 799f26e6980ab78821a4970332a36fcde3036af5 Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 19 May 2020 20:23:51 +0900 Subject: [PATCH] [Refactor] #40392 Separated let_player_build_character() from player_birth_wizard() --- src/birth/birth-wizard.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/birth/birth-wizard.c b/src/birth/birth-wizard.c index 163323099..45ccb9a73 100644 --- a/src/birth/birth-wizard.c +++ b/src/birth/birth-wizard.c @@ -235,6 +235,27 @@ static bool let_player_select_personality(player_type *creature_ptr) return TRUE; } +static bool let_player_build_character(player_type *creature_ptr) +{ + char buf[80]; + if (!get_player_sex(creature_ptr, buf)) + return FALSE; + + if (!let_player_select_race(creature_ptr)) + return FALSE; + + if (!let_player_select_class(creature_ptr)) + return FALSE; + + if (!get_player_realms(creature_ptr)) + return FALSE; + + if (!let_player_select_personality(creature_ptr)) + return FALSE; + + return TRUE; +} + static void display_initial_options(void) { clear_from(10); @@ -461,19 +482,7 @@ bool player_birth_wizard(player_type *creature_ptr, void (*process_autopick_file put_str(buf, 12 + (n / 5), 2 + 15 * (n % 5)); } - if(!get_player_sex(creature_ptr, buf)) - return FALSE; - - if (!let_player_select_race(creature_ptr)) - return FALSE; - - if (!let_player_select_class(creature_ptr)) - return FALSE; - - if (!get_player_realms(creature_ptr)) - return FALSE; - - if (!let_player_select_personality(creature_ptr)) + if (!let_player_build_character(creature_ptr)) return FALSE; display_initial_options(); -- 2.11.0