OSDN Git Service

[Refactor] msg_print に渡す引数の冗長なメンバ関数呼び出しを削除する
authorHabu <habu1010+github@gmail.com>
Mon, 14 Mar 2022 14:02:51 +0000 (23:02 +0900)
committerHabu <habu1010+github@gmail.com>
Mon, 14 Mar 2022 14:02:51 +0000 (23:02 +0900)
msg_print の引数の型を std::string_view にした事により不要になった const char*
型への変換を行うメンバ関数の呼び出しを削除する。

src/effect/effect-player.cpp
src/main/game-data-initializer.cpp
src/object-use/item-use-checker.cpp
src/room/rooms-pit-nest.cpp
src/status/bad-status-setter.cpp
src/wizard/wizard-game-modifier.cpp

index 041d811..db22352 100644 (file)
@@ -86,7 +86,7 @@ static bool process_bolt_reflection(PlayerType *player_ptr, EffectPlayerType *ep
         mes = _("攻撃が跳ね返った!", "The attack bounces!");
     }
 
-    msg_print(mes.data());
+    msg_print(mes);
     POSITION t_y;
     POSITION t_x;
     if (ep_ptr->who > 0) {
index a3ad747..0b5458d 100644 (file)
@@ -53,7 +53,7 @@ void init_quests(void)
         std::stringstream ss;
         ss << _("ファイル読み込みエラー: ", "File loading error: ") << r.what();
 
-        msg_print(ss.str().c_str());
+        msg_print(ss.str());
         msg_print(nullptr);
         quit(_("クエスト初期化エラー", "Error of quests initializing"));
     }
index 9bb5522..3366d5c 100644 (file)
@@ -13,7 +13,7 @@ bool ItemUseChecker::check_stun(std::string_view mes) const
 {
     auto penalty = this->player_ptr->effects()->stun()->get_item_chance_penalty();
     if (penalty >= randint1(100)) {
-        msg_print(mes.data());
+        msg_print(mes);
         return false;
     }
 
index e98772e..c58df87 100644 (file)
@@ -967,7 +967,7 @@ bool build_type13(PlayerType *player_ptr, dun_data_type *dd_ptr)
         what[i] = what[i * 2];
 
         if (cheat_hear) {
-            msg_print(r_info[what[i]].name.c_str());
+            msg_print(r_info[what[i]].name);
         }
     }
 
index f51f41c..71eebcc 100644 (file)
@@ -528,7 +528,7 @@ bool BadStatusSetter::process_stun_effect(const short v)
 void BadStatusSetter::process_stun_status(const PlayerStunRank new_rank, const short v)
 {
     auto stun_mes = PlayerStun::get_stun_mes(new_rank);
-    msg_print(stun_mes.data());
+    msg_print(stun_mes);
     this->decrease_int_wis(v);
     if (PlayerClass(this->player_ptr).lose_balance()) {
         msg_print(_("型が崩れた。", "You lose your stance."));
@@ -617,7 +617,7 @@ void BadStatusSetter::decrease_charisma(const PlayerCutRank new_rank, const shor
 {
     auto player_cut = this->player_ptr->effects()->cut();
     auto cut_mes = player_cut->get_cut_mes(new_rank);
-    msg_print(cut_mes.data());
+    msg_print(cut_mes);
     if (v <= randint1(1000) && !one_in_(16)) {
         return;
     }
index d4c2924..4748a13 100644 (file)
@@ -184,6 +184,6 @@ void wiz_restore_monster_max_num(MonsterRaceId r_idx)
 
     std::stringstream ss;
     ss << r_ptr->name << _("の出現数を復元しました。", " can appear again now.");
-    msg_print(ss.str().c_str());
+    msg_print(ss.str());
     msg_print(nullptr);
 }