From b14268a4d4c16c88a703879194555773477d2135 Mon Sep 17 00:00:00 2001 From: Hourier Date: Fri, 30 Apr 2021 09:13:09 +0900 Subject: [PATCH] [Fix] #963 Resolved the indication that unique_ptr should be PlayerAlignment --- src/io-dump/character-dump.cpp | 3 +-- src/knowledge/knowledge-self.cpp | 3 +-- src/player/player-status.cpp | 3 +-- src/view/display-player.cpp | 3 +-- src/view/display-self-info.cpp | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/io-dump/character-dump.cpp b/src/io-dump/character-dump.cpp index 5e95f2346..c9d34fc44 100644 --- a/src/io-dump/character-dump.cpp +++ b/src/io-dump/character-dump.cpp @@ -452,8 +452,7 @@ static void dump_aux_virtues(player_type *creature_ptr, FILE *fff) fprintf(fff, "%s ???\n", stat_names[v_nr]); } - std::unique_ptr alignment(new PlayerAlignment(creature_ptr)); - std::string alg = alignment->get_alignment_description(); + std::string alg = PlayerAlignment(creature_ptr).get_alignment_description(); fprintf(fff, _("\n属性 : %s\n", "\nYour alignment : %s\n"), alg.c_str()); fprintf(fff, "\n"); dump_virtues(creature_ptr, fff); diff --git a/src/knowledge/knowledge-self.cpp b/src/knowledge/knowledge-self.cpp index b53c11ddc..6650570c8 100644 --- a/src/knowledge/knowledge-self.cpp +++ b/src/knowledge/knowledge-self.cpp @@ -36,8 +36,7 @@ void do_cmd_knowledge_virtues(player_type *creature_ptr) if (!open_temporary_file(&fff, file_name)) return; - std::unique_ptr alignment(new PlayerAlignment(creature_ptr)); - std::string alg = alignment->get_alignment_description(); + std::string alg = PlayerAlignment(creature_ptr).get_alignment_description(); fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), alg.c_str()); dump_virtues(creature_ptr, fff); angband_fclose(fff); diff --git a/src/player/player-status.cpp b/src/player/player-status.cpp index 862f5395f..a88346d70 100644 --- a/src/player/player-status.cpp +++ b/src/player/player-status.cpp @@ -2555,8 +2555,7 @@ void update_creature(player_type *creature_ptr) if (any_bits(creature_ptr->update, (PU_BONUS))) { reset_bits(creature_ptr->update, PU_BONUS); - std::unique_ptr alignment(new PlayerAlignment(creature_ptr)); - alignment->update_alignment(); + PlayerAlignment(creature_ptr).update_alignment(); update_bonuses(creature_ptr); } diff --git a/src/view/display-player.cpp b/src/view/display-player.cpp index 66e7981d2..f91c74ba6 100644 --- a/src/view/display-player.cpp +++ b/src/view/display-player.cpp @@ -134,8 +134,7 @@ static void display_phisique(player_type *creature_ptr) display_player_one_line(ENTRY_WEIGHT, format("%d", (int)creature_ptr->wt), TERM_L_BLUE); display_player_one_line(ENTRY_SOCIAL, format("%d", (int)creature_ptr->sc), TERM_L_BLUE); #endif - std::unique_ptr alignment(new PlayerAlignment(creature_ptr)); - std::string alg = alignment->get_alignment_description(); + std::string alg = PlayerAlignment(creature_ptr).get_alignment_description(); display_player_one_line(ENTRY_ALIGN, format("%s", alg.c_str()), TERM_L_BLUE); } diff --git a/src/view/display-self-info.cpp b/src/view/display-self-info.cpp index 47f7dbc41..5f664ac55 100644 --- a/src/view/display-self-info.cpp +++ b/src/view/display-self-info.cpp @@ -35,8 +35,7 @@ void display_max_base_status(player_type *creature_ptr, self_info_type *self_ptr void display_virtue(player_type *creature_ptr, self_info_type *self_ptr) { self_ptr->info[self_ptr->line++] = ""; - std::unique_ptr alignment(new PlayerAlignment(creature_ptr)); - std::string alg = alignment->get_alignment_description(true); + std::string alg = PlayerAlignment(creature_ptr).get_alignment_description(true); sprintf(self_ptr->plev_buf, _("現在の属性 : %s", "Your alignment : %s"), alg.c_str()); strcpy(self_ptr->buf[1], self_ptr->plev_buf); self_ptr->info[self_ptr->line++] = self_ptr->buf[1]; -- 2.11.0